$( 'a[rel$=" external "]' ).click( function (){
this .target = "_blank" ;
});
/*
:
<a href="http://www.lepinskidesign.com.br/" rel="external">lepinskidesign.com.br</a>
*/
* This source code was highlighted with Source Code Highlighter .
$( 'element' ).size();
* This source code was highlighted with Source Code Highlighter .
jQuery.preloadImages = function ()
{
for ( var i = 0; i<arguments.length; i++)
{
jQuery( "<img>" ).attr( "src" , arguments[i]);
}
};
//
$.preloadImages( "image1.gif" , "/path/to/image2.png" , "some/image3.jpg" );
* This source code was highlighted with Source Code Highlighter .
//A. Safari
if ( $.browser.safari ) $( "#menu li a" ).css( "padding" , "1em 1.2em" );
//B. IE6
if ($.browser.msie && $.browser.version > 6 ) $( "#menu li a" ).css( "padding" , "1em 1.8em" );
//C. IE6
if ($.browser.msie && $.browser.version <= 6 ) $( "#menu li a" ).css( "padding" , "1em 1.8em" );
//D. Firefox 2
if ($.browser.mozilla && $.browser.version >= "1.8" ) $( "#menu li a" ).css( "padding" , "1em 1.8em" );
* This source code was highlighted with Source Code Highlighter .
var el = $( '#id' );
el.html(el.html().replace(/word/ig, "" ));
* This source code was highlighted with Source Code Highlighter .
function equalHeight(group) {
tallest = 0;
group.each( function () {
thisHeight = $( this ).height();
if (thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height(tallest);
}
/*
:
$(document).ready(function() {
equalHeight($(".recent-article"));
equalHeight($(".footer-col"));
});
*/
* This source code was highlighted with Source Code Highlighter .
$( document ).ready( function (){
//
var originalFontSize = $( 'html' ).css( 'font-size' );
$( ".resetFont" ).click( function (){
$( 'html' ).css( 'font-size' , originalFontSize);
});
//
$( ".increaseFont" ).click( function (){
var currentFontSize = $( 'html' ).css( 'font-size' );
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*1.2;
$( 'html' ).css( 'font-size' , newFontSize);
return false ;
});
//
$( ".decreaseFont" ).click( function (){
var currentFontSize = $( 'html' ).css( 'font-size' );
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*0.8;
$( 'html' ).css( 'font-size' , newFontSize);
return false ;
});
});
* This source code was highlighted with Source Code Highlighter .
$( document ).ready( function (){
$( document ).bind( "contextmenu" , function (e){
return false ;
});
});
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/54306/
All Articles