gMaps – Google maps jQuery plugin
A nice jQuery plugin worth trying.
A nice jQuery plugin worth trying.
jQuery(‘iframe’).each(function() {
var url = jQuery(this).attr(“src”)
jQuery(this).attr(“src”,url+”?wmode=transparent”)
});
// Retrieve current URL
var url = document.URL;
// Retrieve root URL
var root = location.protocol + ‘//’ + location.host;
// Redirect – insert required URL
window.location.href = “http://designchemical.com/”;
//Highlight Current Menu Item
var url = document.URL;
$(‘#menu a[href="'+url+'"]‘).addClass(‘active’);
//Check If Link Contains External URL, open it in new tab
var root = location.protocol + ‘//’ + location.host;
$(‘a’).not(‘:contains(root)’).click(function(){
this.target = “_blank”;
});
Can also check the proper highlighted version at http://pastebin.com/x4A3hszn
Hi all,
This is a simple script to adjust the vertical position of a radio button to the center corresponding with the label next to it. This is particularly useful when the label text is too long and flows down multiple lines. My code assumes your radio buttons are wrapped in a li item, it could be anything in your case, or just the label placed next to the radio button.
Calculation by: Sagar
Coded by: Rutwick
/* Vertical align radio button */
jQuery(”).each(function(){
var h = jQuery(this).height();
var i = jQuery(this).find(‘input’).css(‘margin’, 0).height();
var eh = h – i;
var ch = eh / 2;
jQuery(this).find(‘input’).css(‘margin-top’, parseInt(ch));
});
Hope it helps you!
Check out @ http://pastebin.com/ij6xeeGT
For javascript substring reference: http://www.w3schools.com/jsref/jsref_substring.asp
Read @ http://webtips.in/2012/01/auto-load-and-refresh-div-with-jquery-in-every-10-seconds.html
Useful jQuery Tutorials to Enhance WordPress Site
http://www.dynamicwp.net/articles-and-tutorials/useful-jquery-tutorials-wordpress-website/
To vertically center an image inside a div tag we can use display:table-cell and vertical-align: middle as the css for the div , which will work for modern browsers.
Lets take an example
Suppose I have the following markup.
We can apply the following css to get the image vertically as well as horizontally(text-align:center) centered
.image {
display: table-cell;
height: 120px;
text-align: center;
vertical-align: middle;
width: 175px;
}
Now to get the same effect on IE7 (since IE7 doesn’t support table-cell value for display) we can use jQuery.
The code is given below
jQuery(‘.ie7 .image img ‘).each(function () {
var img_height=jQuery(this).height();
var padding_value=(120-parseInt(img_height))/2+’px’;
jQuery(this).css(‘padding-top’,padding_value);
});
This code will vetically center all images contained in the div having the class “image”
var padding_value=(120-parseInt(img_height))/2+’px’; on this line 120 refers to the height of the div
Note:Image dimension should be less than the “div” dimension
The markup is as follows
<div class=”image”>
<img alt=”imagetext” src=”http://imagepath”/>
</div>
Guys,
If you are stuck with CSS which is having !important as a value for the property and as you must be knowing, jQuery doesn’t use !important value, and lets suppose it is a “must” thing for you to change the value through jQuery,then, you can use cssText property.
Here is an example,
Suppose i have a CSS statement.
#rtp-nav-menu li ul { display: none !important; color:#000000;}
jQuery for this is
jQuery( ‘#rtp-nav-menu li ul ‘).css({‘cssText’: ‘display: block !important’,'color’:'#000000′});
Remember that you give cssText property first as it overrides any style associated with the particular element.
Check this out.. http://razorjack.net/quicksand/
Its another jQuery for sorting elements with various demos. It is much like Isotope.