www.webdeveloper.com
Results 1 to 2 of 2

Thread: Set z-index of current div in scrollTo function

  1. #1
    Join Date
    Jun 2012
    Posts
    1

    Set z-index of current div in scrollTo function

    Simple question, How can I set the Z-INDEX of the current div higher than the other divs in the script below?

    A little more info:
    I have a page using scrollTo that works perfectly except ONE problem. If you add a minimum width, when you resize the browser smaller than minimum and scroll horizontally, the divs outside of the masked area overlap the current content...


    Code:
    $(document).ready(function() {
    	$('li:eq(0) a.panel').addClass('selected');
    	//get all link with class panel
    	$('a.panel').click(function () {
                    //reset and highlight the clicked link
    		$('a.panel').removeClass('selected');
    		$(this).addClass('selected');
    		//grab the current item, to be used in resize function
    		current = $(this);
                    //scroll it to the destination
    		$('#about-page-wrapper').scrollTo($(this).attr('href'), 700);
    		window.location.hash = $(this).attr('href');
                    //cancel the link default behavior
    		return false;
    	});
    	//resize all the items according to the new browser size
    	$(window).resize(function () {
    		//call the resizePanel function
    		resizePanel();
    	});
    });
    Your help would be greatly appreciated!

  2. #2
    Join Date
    Jan 2005
    Posts
    335
    This should be pretty easy - either add a
    Code:
    style
    atribute to your div with the required z-index, or add a
    Code:
    className
    to your div and set the z-index in your CSS.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles