Skip to main content

BLINK EFFECT IN HTML DOCUMENT USING JQUERY



Different effect makes your website more attractive to visitors and blinking effect is most effective way to grab user attention. We all are know blinking tag in HTML code. But, “blink” tag is not support in all web browsers. We can use flowing jQuery blink scripts as an alternative of HTML blink tag. That’s why today we are going to create a simple but impressive blinking effect using jQuery and CSS3. Blinking effect techniques that, we FadeIn(show) and FadeOut(hide) an item(text/image) with 1sec interval. If you want you can increase time interval. You will create blink effect for both text and image.

Here I’m going to show effects both for text image. I hope you will like both of them. Have a look at the scripts and it’s so simple and easy to implement.

- jQuery Scripts For Image Blink Fade In Effect:



$(function(){

/*Hover effect*/

$("#my_image").hover(function(){
$(this).addClass("blinking");
}, function() {
$(this).removeClass("blinking");
});

/*Start blinking on document ready.*/

$("#hover_blink").addClass("blinking");

});

You just need to define an image ID that you want blink. Example: #my_image

- jQuery Scripts For Text Blink Fade In Effect:



$(function(){

/*Here post_title is a h2 tag Id.*/

$("#post_title").addClass("blinking");

/*Following example first we select a class and then find those
*elements those contain storng tag and blink text
*inside strong tag*/

$(".text_blink_effect").find("strong").addClass("blinking");

});

- CSS3 Scripts For Image Blink Fade In Effect:



body{
font-family: verdana;
font-size: 12px;
width: 500px;
margin: 0 auto;
margin-top: 40px;
}

img{
cursor: pointer;
}

/*Add a simple ccs3 animation effect in here.
*If you want to increase/decrease blink time you can change it easily.
*add any interval amount instead of 2s.
*/

.blinking{
-webkit-animation: blink 2s infinite;
-moz-animation: blink 2s infinite;
animation: blink 2s infinite;
}

@-webkit-keyframes blink{

0%{ opacity:0;}
100%{opacity:1;}
}

@-moz-keyframes blink{

0%{ opacity:0;}
100%{opacity:1;}

}

@keyframes blink{

0%{ opacity:0;}
100%{opacity:1;}

}

Comments

Popular posts from this blog

Wo-commerce sidebar navigation

There is Plus Minus Image you can change it in your own code

How to add attribute in input type onload

Add this script this will target your input type submit and set an attribute on it when page load. <script> function functionAddAttribute(){     $("input:submit").attr("accesskey","g"); }; window.onload = functionAddAttribute; </script> <noscript>Your browser does not support JavaScript!</noscript> This is html <input type="submit" value="this is button" />

HOW TO IMPLEMENT ADAPTIVE IMAGE IN WORDPRESS

If you don't know about Adaptive image please Read my last artical. STEP:1 COPY .htaccess , Adaptive-image.php, ai-cookie.php, DS_Store file in your root directory STEP 2: CREATE folder in wp-contant/uploads/adaptive/ai-cache if .htaccess file already exist then pest this code in it but be carefull take its backup CODE #START Adaptive-Images #Add any directories you wish to omit from the Adaptive-Images process on a new line. #Omit plugins, wp-includes and wp-admin content. RewriteCond %{REQUEST_URI} !wp-content/plugins RewriteCond %{REQUEST_URI} !wp-includes RewriteCond %{REQUEST_URI} !wp-admin #Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories #to adaptive-images.php so we can select appropriately sized versions RewriteRule .(?:jpe?g|gif|png)$ adaptive-images.php #END Adaptive-Images UNDER # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On STEP3: Open Adaptive-image.php change with it $cache_path    = "wp-content/upl...