Results 1 to 2 of 2

Thread: Simple/Quick (I hope) jQuery fix needed

  1. #1
    Join Date
    Jan 2010

    Simple/Quick (I hope) jQuery fix needed

    Hi all. I've been trying to teach myself jquery/javascript and am in the beginning stages still. I had found a great rollover function for jquery online that works perfectly. I was trying to add on to it though and am out of ideas due to my lack of knowledge. Was hoping for a point in the right direction or a fix if you know it.

    The code below is very simple to see whats going on. I'm trying to add a function to it that will keep a button in a "selected" state based on what page you are on. The "hover" class that is getting called is what I need to have stay "up/selected".

    I was trying to accomplish this by creating a variable called "thisLocation" but the accompanying function isn't working. I thought I could create an "if/else" function that would look for different values and then place the "thisLocation" variable on a few template pages and obviously change their values. Does that make sense?

    I'm sure it's a beginners' issue and am really hoping someone can help me. Also, this is just the way I thought would be easiest to make this work, maybe you know something better???

    The not working code I wrote starts at "var thisLocation...", everything before it is the function I found and is working perfectly.

    Thanks in advance.

    $(document).ready(function () {
    	//Append a div with hover class to all the LI
    	$('#navBar li').append('<div class="hover"><\/div>');
    	$('#navBar li').hover(
    		//Mouseover, fadeIn the hidden hover class	
    		function() {
    		//Mouseout, fadeOut the hover class
    		function() {
    var thisLocation = 'pageone';
    if (thisLocation == 'pageone')
    		$(document).getElementsByName('buttonone').append('<div class="hover"><\/div>');

  2. #2
    Join Date
    Jan 2010
    No one at all?! Ah. Is it that complicated an issue? I've still been looking for a solution but have yet to find it.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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