Aug
11th

Stop Sniffing my Browser Type!

Quite often Opera users complain that their favorite browser cannot parse a web page and gives the following error:

Continue Reading

Jul
21st

Cross-browser box-shadow for a fixed size block.

In a recent article we’ve discussed creating the box-shadow effect viewable in all browsers with the use of filters.  The method has a number of drawbacks of which the biggest is performance.  Here’s another method that’s aimed at efficiency and performance, though it can only be used on blocks with fixed width and height.

As usual, it’s quite simple for the compliant browsers:

Continue Reading

May
5th

CSS. Cross-browser layouts of formatted code.

First, what the article is about. The Internet is full of articles on layouts and programming. Many authors choose to include code snippets on top of text and images. The code in those snippets is formatted one way or another. To make their life easier the authors use various tools like Source Code Highlighter or alike. Everything seems good – the syntax is highlighted, the tabulation is in place, lines are numbered. Yet all such utilities have one bid disadvantage that makes life difficult: tabulation replaces all symbols in the code with spaces. And since most layout editors and programmers use tabs for indentation – copying the snippet into the source code requires additional effort to fix the code hierarchy.

Noting the above, the topic of this article can be rephrased: how to format code in such a manner that copy-pasting it would keep the tab-ed indentation that most people are used to.

Continue Reading

Apr
30th

Tips about using jQuery. LocalScroll plugin with CSS selector «:target».

There are many hyperlinks like < a href=«#idName» > … < /a > on different web pages that do not take you to another page, but rather to a place (target) on the same page. This is common practice for large articles with an index in which every item is a link to the corresponding heading. In the case of a footnote – the superscript is linked to the bottom of the article and the footer itself has a link back to the text. There is a great number of articles written in this fashion in different network encyclopedias and in journals.
Unfortunately most of todays browsers simply jump to the place where the hyperlink points. This is very different from scrolling that happens slowly and takes some notable time in a way that it can give the reader a sense of how much information is being skipped.

Rather unfortunate, isn’t it?

Fortunately there’s a jQuery plugin that let’s one create the effect of text scrolling upon clicking the target link. This scroll simulation looks just like scrolling by hand but happens automatically and much faster – within a second by default. In this way the user gets the sense of the amount of information going by but doesn’t have the time to get bored.

The plugin is called jQuery.Local.Scroll, it requires jQuery and another plugin – jQueryScrollTo which it encapsulates. Once jQuery and both aforementioned plugins are installed a function call that will activate automatic scrolling for all internal hyperlinks this simple:

Continue Reading