Expanding Images using HTML5′s contenteditable tabindex
HTML5 has a new attribute, contenteditable, which can be applied to any element which allows it to be edited directly in the browser window. Think of text input with a predefined value, but it can literally be any element. Form elements like text inputs support the :focus pseudo class, which allow us to style those elements when they are clicked upon or otherwise navigated to. Giving an element the contenteditable attribute means it also now supports the :focus pseudo class, which opens up some interesting possibilities!
We’ll exploit this little trick to make an expanding image (like a lightbox without the overlay) right within some content.
UPDATE: Even better, you can give attributes a tabindex attribute, like you would a form element, which allow allows :focus without the editability. This article has been updated to go that route instead.
HTML5 has nice elements for including captioned images.
Jump!
We just give the figure element tabindex, so that it can be in focus.
Give each subsequent figure a tabindex value one higher and the images will be able to be tabbed through nicely from the keyboard! The Images
The images will be “full size”.
This means they will be scaled down for regular display on the page, and scaled up when we do our magical CSS expanding. Potentially a waste of bandwidth for the browsers that don’t support this. The tradeoff is your call.
The :focus part of this isn’t CSS3, the but shadows, transforms, and transitions are. The hover state will rotate the image a bit, and the :focus style (when the image is clicked on), will expand it, rotate it again, and make sure it’s on top with z-index.
The HTML5 contenteditable attribute is supported in Firefox 3.6+, Safari 4+, Chrome, and Opera (10.6 only tested). Note that the attribute will cascade down to all child elements. In our demo, having the image and figure caption be editable doesn’t make much sense, so we can turn it off individually on them.
Jump!
Opera respects the child elements not being editable, but still runs the spellchecker on them and will red-underline words it finds misspelled which can be a bit weird.
Our demo also relies upon transforms to “work” though, which are only supported in current WebKit browsers and Firefox 4+. Firefox 3.6 supports the transform but not the transition.
The fallback is that the images just don’t expand though, which is of course no big deal.
Photo Optimization is necessary to allow a web page to load in the shortest amount of time possible. Fast loading time require small files. This article discusses the methods used for photo optimization. In an ideal world, a web designer could use the highest quality photos and have the webpage download lightening fast. Fast loading requires small file sizes for pictures. Unfortunately, there is a trade off between picture quality and file size. Web surfers are a notoriously impatient bunch. If a website takes too long to load, they will just click away and never come back. Computer monitors can only display images at 72dpi (dots per inch). So the first step in photo optimization is to reduce the resolution to 72 dpi. Large picture can be sliced up into smaller ones and the put back together on the web page. Each piece will be a very small file and together will load in a fraction of the time a single image file would load. Most graphic files contain information about the color palette...
Technology has made businesses to run more conveniently. Now it is possible to get the response from the customers about a particular product or service at a greater speed. The reason is simple- A Faster Interaction. The customers and prospects want to speak what they like and what they expect from a particular brand. They have become more knowledgeable. They are not satisfied just by availing services given by the service provider. In turn they are looking for more. They want to be a part of your community and want to connect. They want to tell what they are feeling about a particular product or service. By making your website interactive you can help your customers and prospects to connect. You can boost interactivity in your website by using technology effectively. Let us see how: Ask people to comment on your blogs. This increases interactivity in your website. People would not take pain to comment on your blog unless they find something valuable, something interesting or something...
Effective search engine optimization is absolutely crucial for any website proprietor that likes to boost their traffic. No issue how many promotion you location on other websites and in the press the best way to get a bigger number of exclusive tourists is through search engine rankings and online directories.The idea behind seo edinburgh is to make your world broad web falls as appealing as likely to the engine crawlers. You may have a attractively conceived website that comprises unbelievable images and a flawless layout for reading but this solely will not advance your search rankings, there are other components that are important.If you believe of the times when you use one of the foremost search engines you should inquire yourself how many distinct falls do you actually gaze through? It is rather uncommon for any individual to get to the fourth of fifth falls of the results. For creative search engine optimisation edinburgh your location desires to be on the very first page.There...