background preloader

JQuery Basic Page Layout

Facebook Twitter

How to create a fluid grid with jQuery « CreativityDen. 14th Dec Grid-based layout is probably the more preferred way to style up a webpage to give it more magazine-like look and feel. This tutorial is about how to use CSS and Javascript to create a fluid grid-based layout ( See demo here ). The algorithm/procedure used in this tutorial is very simple and straightforward. There are more advanced algorithms out there which can handle multiple scenarios. But the purpose is to understand the basic logic on how to create such layout. So here it goes… Step 1: Preparing the HTML First we need to create a basic HTML structure. < title >Fluid grid</ title > < div class = "box" >< p >< span >01</ span >This is box number 1... </ p ></ div > < div class = "box alt" >< p >< span >02</ span >This is box number 2...

</ p ></ div > < div class = "box" >< p >< span >03</ span >This is box number 3... </ p ></ div > < div class = "box alt" >< p >< span >04</ span >This is box number 4... </ p ></ div > Step 2: Style up a little bit body { position: relative; width: 100%; Blog Archive » Character Justification using JQuery. Justification using pure CSS can be achieved by setting the text-align property to “justify”. This will tell the browser to attempt to line up the words so that left the and right edges of each line are aligned with those above and below. This effectiveness of this property can be enhanced by inserting hyphens where necessary to maintain the alignment using Hyphenator (here’s an example). The “text-align: justify” technique is useless when applied to a list or similar column of text where each item or line only has one or two words in it.

For example in a navigation menu. I had the requirement to build a navigation sidebar with justified text for Caragh’s still unfinished website so rather than wait for CSS3 cross browser support I decided to find a solution. $(document).ready(function(){ $(".justify").characterJustify(); }); Examples: Plugin source. ThreeDots: The jQuery Ellipsis Plugin « The Product Guy. Sometimes the text … … is too long … … won’t fit within the number of rows you have available. Sometimes all you need is … ThreeDots! (a jQuery plugin) For example — … and most any other permutation you desire. To Ellipsize There are many scenarios in the display of online text where shortened, truncated representations are best used.

El·lip·sis (ĭ-lĭp‘sĭs) n., pl., -ses (-sēz). The omission of a word or phrase necessary for a complete syntactical construction but not necessary for understanding.An example of such omission. [Latin ellīpsis, from Greek elleipsis, from elleipein, to fall short. Many online products employ ellipses within their products to improve various aspects of the User Experience, such as: allowing for easy summary scanning of page content, and fitting more diversity of content into a smaller space. Most often people truncate the text by character count, on both the client- and server-sides, which does not take into account the variable dimensions of the text being truncated. HeatColor, a jQuery plugin. What is it? HeatColor is a plugin that allows you to assign colors to elements, based on a value derived from that element. The derived value is compared to a range of values, either determined automatically or passed in, and the element is assigned a "heat" color based on its derived value's position within the range.

You bind a collection of elements such as table rows, divs or list members to heatcolor and let it do the work. It can find the min and max values of the desired elements, or you can pass them in manually. Examples Each example is followed by the code used in the example. Example 1: Passing in table rows, used in conjunction with the tablesorter plugin. Example 2: 10-point rating system Example 3: Using list elements - using value attribute of list elements, green to red color style How much do you love cotton candy? Not at all: 60%A little: 30%Some: 8%A lot: 2% Download Download jquery.heatcolor.0.0.1.js (6K) Download jquery.heatcolor.0.0.1.pack.js (2K) Usage History Contact.

Sponsor Flip Wall With jQuery & CSS – Tutorialzine. Martin Angelov Designing and coding a sponsors page is part of the developer’s life (at least the lucky developer’s life, if it is about a personal site of theirs). It, however, follows different rules than those for the other pages of the site. You have to find a way to fit a lot of information and organize it clearly, so that the emphasis is put on your sponsors, and not on other elements of your design. We are using PHP, CSS and jQuery with the jQuery Flip plug-in, to do just that.

The resulting code can be used to showcase your sponsors, clients or portfolio projects as well. Step 1 – XHTML Most of the markup is generated by PHP for each of the sponsors after looping the main $sponsor array. Demo.php <div title="Click to flip" class="sponsor"><div class="sponsorFlip"><img alt="More about google" src="img/sponsors/google.png"></div><div class="sponsorData"><div class="sponsorDescription"> The company that redefined web search. Maybe more interesting is the sponsorData div. Step 2 – CSS. jQuery replaceText: String replace for your jQueries. jQuery replaceText will replace text in specified elements. Note that only text content will be modified, leaving all tags and attributes untouched. Recently, Paul Irish asked me how I would go about “wrappifying” text on a page with span tags, presumably for some CSS styling.. and he knows that if he mentions something enough, there’s a pretty good chance I’ll make a jQuery plugin for it.

Of course, he’s right, so.. here’s the plugin. And Paul, you’d better use this thing! So, why not just set .html( new_text ) ? While using the jQuery .html() method is one of the fastest ways to replace text in a huge HTML structure, when you do this, all event handlers and references bound to any child elements are lost. Now, if you have no event handlers or references to these elements, just update the .html() using a standard string replace, and everything will be super-fast! So, are there any caveats? Not really. So, how do I use this thing? It’s easy! 02. 06.function embolden( str ){ 10. 15. 21. 22. 32.