Tag Archives: jQuery

Archive

Simple image rotater with fadeIn fadeOut effect using jQuery

jQuery-Image-Rotator

One may find it useful for rotating images with fadeIn fadeOut effect using jQuery.

How it works?

It collects image elements grouped by class name and rotates them within an image element which is identified by element ID. Continue reading

Category: jQuery | Tags: , , , ,

Vector Digital Clock jQuery Plugin (beta)

Vector Digital Clock jQuery Plugin (beta)

Vector Digital Clock plugin was created to show Digital Clock in more computerized and presentable way. With this plugin it is possible to show each digit or character of time in form of Digital Vector or character. This plugin works for different timezones and also takes care of the time differences arisen due to difference between your computer time and the server time. Continue reading

Category: jQuery | Tags: , , , ,

Fix to jQuery ui calendar not appearing from or hiding behind thickbox

If you are facing an issue of jQuery ui calendar not appearing while clicked from a jQuery thickbox or if some part of the calendar hiding behind the thickbox window you need to apply a quick fix to your calendar. Continue reading

jQuery pop up message box sliding from left to right and positioning horizontally at the center

Just wrote a simple sliding box script to make a message box appear sliding from left to the middle of web page. The box appears once a day. The first appearance is logged into a browser cookie, so if user opens the same website and if cookie was expired it appears again. Continue reading

A simple javascript image slide show using setTimeout and jQuery

Just now i created a small slideshow. The slideshow uses some static images stored in a javascript object (array) and runs till the last image in this array. For example, the array: Continue reading

Form DOM element not recognized (created) in ajax form in IE when placed with end tag missing

Skipping a form end tag </form> costed me almost a day (i had to go to bed abandoning the fixing for some time though;)). I had been using ajaxForm with jQuery to submit ajax form which was placed on a popup dialog box opened through ajax. The form worked well in Mozilla Firefox, Google Chrome, Safari but did not work in Internet Explorer 7 & 8 (IE7 & IE8 ; i didn’t test in other versions of IE but perhaps they would not work either). The IE simply would not create the <form> tag at all so if you try to alert $(“#formID”).length it would return always 0(zero). It started to work fine (in IE) when i placed </form> to mark the end of the form (i know it was a mistake to not to place it there though). Continue reading

A note on DOM elements’ changed scope when using thickbox with jQuery

A similar situation may arise (atleast for me it did) when you try to invoke jQuery’s “thickbox” in conjunction with a custom onclick firing. I would explain it with the help of an example:

I have a div element (with id “myBlockTOShow”, i would say it “#myBlockTOShow” in this post further) which i display/present as a “thickbox” when a href tag/link is clicked. Here is how the div element looks like: Continue reading

Category: jQuery | Tags: , , ,

How to prevent parent’s onclick event from firing when a child tag is clicked with jquery?

Generally, Javascript events bubble (listen) to the highest point in the DOM to which a click event had been attached. So even if you don’t have any other explicitly click-able elements in the div, every child element of the div would bubble their click event up the DOM to until the DIV’s click event handler catches it. Continue reading

Setting Style/CSS of select options using jQuery

This is how i set style (color here) of all of the options of a select list using jQuery.

In my case i had select options like this:

<select id=”select_list_id”>
<option value=”#595959″>Grey</option>
<option value=”#000000″>Black</option>
<option value=”#036″>Blue</option>
<option value=”#363″>Green</option>
<option value=”#632423″>Red</option>
<option value=”#403152″>Purple</option>
<option value=”#E36C0A”>Orange</option>
</select>

Follwoing the jQuery code i used to set color of options above:

  $(document).ready(function(){
	$('#select_list_id option', this).each(	
		function ()	{
			$(this).css({'color':$(this).val()});
		}
	)
  });

Autocomplete=”off” workaround / fix for valid XHTML

Add an onload function similar to the following to <head> section of your web page.

<script type="text/javascript">
function onload_call() {
if (!document.getElementById) return false;
var f = document.getElementById('field_name');
f.setAttribute("autocomplete", "off");
}
</script>

Continue reading