javascript - How can add fade In() effect to each appearance of a div when the mouse click? -


how can add fadein() effect each appearance of div when mouse click?

so when onmouseclick, yellow part showing fadein() effect.

fiddle : http://jsfiddle.net/2ehdw/7/

script :

window.jqueryclick: function (event) {     if (!event.point.selected) {         $('#testdiv').show();         var chart_data = '<div> name: ' + event.point.name + ' share: ' + event.point.y + '</div>';         $('#testdiv').html(chart_data);     } else {         $('#testdiv').hide();     } } 

add parameter .show() method , hide div before showing again:

if (!event.point.selected) {    $('#testdiv').hide();    $('#testdiv').show("300"); //or $('#testdiv').fadein();    var chart_data = 'name: ' + event.point.name + ' share: ' + event.point.y;    $('#testdiv').html(chart_data); } else {    $('#testdiv').hide(); } 

fiddle


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -