Hello,
Quick problem here. On my website I have a button. When user clicks on the button it expands div. you can se how it works here http://inelmo.com/noluck/
As you can see div expands instantly. I want it to slide down. Here is the full .JS file I use for that div
toggle function starts on line 18
I tried to change toggle function from line 18 to this.
but this resulted in that the toggle function started automatically and hided the More / Less Button.
If anyone has any ideas on how to achieve this effect please help me )))
Thank You
Quick problem here. On my website I have a button. When user clicks on the button it expands div. you can se how it works here http://inelmo.com/noluck/
As you can see div expands instantly. I want it to slide down. Here is the full .JS file I use for that div
toggle function starts on line 18
Code:
$(function(){
// The height of the content block when it's not expanded
var adjustheight = 80;
// The "more" link text
var moreText = "More";
// The "less" link text
var lessText = "Less";
// Sets the .more-block div to the specified height and hides any content that overflows
$(".more-less .more-block").css('height', adjustheight).css('overflow', 'hidden');
// The section added to the bottom of the "more-less" div
$(".more-less").append('<p class="continued">[…]</p><a href="#" class="adjust"></a>');
$("a.adjust").text(moreText);
$(".adjust").toggle(function() {
$(this).parents("div:first").find(".more-block").css('height', 'auto').css('overflow', 'visible');
// Hide the [...] when expanded
$(this).parents("div:first").find("p.continued").css('display', 'none');
$(this).text(lessText);
}, function() {
$(this).parents("div:first").find(".more-block").css('height', adjustheight).css('overflow', 'hidden');
$(this).parents("div:first").find("p.continued").css('display', 'block');
$(this).text(moreText);
});
});
Code:
$(".adjust").slideToggle(1000)(function() {
If anyone has any ideas on how to achieve this effect please help me )))
Thank You
Comment