December 5, 201213 yr So i'm toggling a div from display = none to display = block. The div that I am trying to change is being used for a horizontal jquery menu bar that scrolls the content in the div below it from left to right. The problem that I am facing when changing the container div for all of this is that the div with all the content in doesn't display correctly when it is switched. instead of display the content div there is just a small white line. It still scrolls left and right but the first content div is now ontop of the other divs...for some reason.
December 5, 201213 yr Hi, This link may be helpful to you. http://www.learningjquery.com/2006/09/slicker-show-and-hide Please, check demo 1. Thanks
December 5, 201213 yr Author I've tried using Jquery but the same problem occurs. Heres it when it's hidden using .hide, i've also set it to .show when portfolio is clicked. http://www.alexjknight.com/ <Not working, click any of the tabls in portfolio to see. Here it is without any Jquery/CSS hiding the div http://www.alexjknight.com/working/ <working, content scrolls perfectly. Edited December 5, 201213 yr by BITmixit
December 5, 201213 yr Give this a try js/ajk.jquery.js jQuery(document).ready(function($) { $(".scroll").click(function(event){ event.preventDefault(); $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500); }); }); $(document).ready(function() { $('.full-width').horizontalNav({}); $('#porto').click(function() { $('#container').addClass("show"); }); }); add to css #container{position:absolute;visibility:hidden;display:block;} #container.show{position:relative;visibility:visible;}
December 6, 201213 yr Author Give this a try js/ajk.jquery.js jQuery(document).ready(function($) { $(".scroll").click(function(event){ event.preventDefault(); $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500); }); }); $(document).ready(function() { $('.full-width').horizontalNav({}); $('#porto').click(function() { $('#container').addClass("show"); }); }); add to css #container{position:absolute;visibility:hidden;display:block;} #container.show{position:relative;visibility:visible;} This worked perfectly, cheers man and I learnt that you can add classes. Did not know this. Is there a simple Jquery function to push the scroll bar down when expanding the height of the div for the portfolio as the scroll bar doesn't move.
December 6, 201213 yr This worked perfectly, cheers man and I learnt that you can add classes. Did not know this. Is there a simple Jquery function to push the scroll bar down when expanding the height of the div for the portfolio as the scroll bar doesn't move. Why not just plain Javascript ?
Create an account or sign in to comment