I have this jquery code which displays my div and hides it no problem but im having trouble changing it from css display to slideToggle display?
$('l开发者_运维技巧i.trigger').hover(
function() { $(this).css('background-color', '#fff'); $('div', this).css('display', 'block'); },
function() { $(this).css('background-color', '#fff'); $('div', this).css('display', 'none'); });
Give this a go, if u dnt need to slide the div
s then just move .slideUp()
to the line above same with slideDown
$('li.trigger').hover(
function() {
$(this).css('background-color', '#fff');
$('div', this).css('display', 'block').slideUp();
},
function() {
$(this).css('background-color', '#fff');
$('div', this).css('display', 'none').slideDown();
});
$('li.trigger').hover(
function() { $(this).css('background-color', '#0099ff');
$('div', this).css('display', 'block').slideToggle("slow");
});
Heres what worked
$('li.trigger').hover(
function() { $(this).css('background-color', '#fff');$('div', this).slideToggle("slow");
});
精彩评论