Web Design Blog - javascript

Unobtrusive javascript and jquery selectors

Jquery is a great library used by many. Those who are just starting out can become a bit confused by the jquery selector format. I want to take some time today and give you a primer and some examples on using selectors in jquery. Using them effeciently can save you time and headache. If you aren't familiar with unobtrusive javascript techniques, now would be a good time to brush up. If you create your javascript in an "unobtrusive" way, this means that you keep your javascript code separated fr... read more!

Posted in javascript, snippets, technology, tutorials, web design | Post Comment

Simple javascript tabs

We have all seen them, the tabbed views on a web page that split up your content. Did you know how simple it is ( using jquery ) to create this tabbed box. First, lets look at the markup: <div class="tab_set">    <div class="tab_nav">        <ul>            <li id="navtab_details"><a href="javascript:simple_tab('details')">Details</a></li>    &nb... read more!

Posted in javascript | Post Comment | 2

Simple Slideshow with Jquery

Here is a very simple way to create a slideshow using jquery. Setup your xhtml as follows: <div style="position: relative;"><div id="slideshow1" style="position: absolute;"><img src="one.jpg" /></div><div id="slideshow2" style="position: absolute;display: none;"><img src="two.jpg" /></div><div id="slideshow3" style="position: absolute;display: none;"><img src="three.jpg" /></div></div> Each div containing an image is positioned... read more!

Posted in javascript | Post Comment

jquery - getting those pesky dropdown values

If you have coded javascript before, you will know that getting a selected option value from a dropdown is a couple tedious extra steps more than getting a value from a text field. With jquery, no more will you need to treat these two fields differently. If you need the value of a dropdown that has an id of "the_dropdown" you can write a quick jquery call to get it very easily: $('#the_dropdown').val() That's it! It is just that simple. ... read more!

Posted in javascript | Post Comment

javascript, confirm before you go

Sometimes you may want to have a user acknowledge an action and have a second thought about exactly what they are doing before carrying out their request. Javascript fits pretty well for most of these situations. There is a nifty function in javascript named confirm(). This little function takes one argument ( a message for the user ), and presents an alert box to the user showing the message along with an "Ok" and "Cancel" button. If the user clicks ok, confirm returns true, if they click cance... read more!

Posted in javascript | Post Comment | 1


View All Posts