Search Results

Search found 4 results on 1 pages for 'centr0'.

Page 1/1 | 1 

  • JQuery: which element was clicked?

    - by centr0
    I have a list with links. These links are links to tables on the same page. What I want to do is whatever link I click in the list it will show its corresponding table and hide all the others. Without adding a different id/class to each link in the list and its corresponding table, is there a way to find out which element was clicked and show() its table? From what I understand JQuery returns an array object on its selector. How can I find out what element of the array was clicked? I've tried to use event.which but I'm a little lost. Help is greatly appreciated!

    Read the article

  • Jquery: encasing div and anchor link binded to same event.

    - by centr0
    im having trouble figuring out how to bind mouseout() to my entire nav bar including the links. when a user hovers over a link in #nav a sub menu is shown. all is well there. what i want to do is fadeOut that sub menu when the user hovers out of the entire #nav. my code for the mouseout: $('#nav').mouseout(function() { setTimeout(function() { //$('.sub-link').fadeOut(); }, 2000); }); when i hover over an anchor link which resides in #nav, i see the sub-menu. then i guess the mouseout() even fires and the sub-menu fades out. is there anyway to have the #nav and any anchor links within it to act as one? i'd paste my markup but even indenting it 4 spaces still shows as rendered html.. TIA

    Read the article

  • Learning Java and logic using debugger. Did I cheat?

    - by centr0
    After a break from coding in general, my way of thinking logically faded (as if it was there to begin with...). I'm no master programmer. Intermediate at best. I decided to see if i can write an algorithm to print out the fibonacci sequence in Java. I got really frustrated because it was something so simple, and used the debugger to see what was going on with my variables. solved it in less than a minute with the help of the debugger. Is this cheating? When I read code either from a book or someone else's, I now find that it takes me a little more time to understand. If the alghorithm is complex (to me) i end up writing notes as to whats going on in the loop. A primitive debugger if you will. When you other programmers read code, do you also need to write things down as to whats the code doing? Or are you a genius and and just retain it?

    Read the article

  • JQuery: addClass() not changing background on selector

    - by centr0
    im having a little trouble getting the background image to swap out on click() $('.highlight-boxes li a[class!=selected-box]').click(function() { $('.highlight-content').hide(); $('.highlight-boxes li a').removeClass(); $(this).addClass('box-selected'); // problem here var selected = $(this).attr('href').substr(1); $('#' + selected).stop(true,true).fadeIn(); return false; }); console.log() in firebug returns the correct element being clicked but $(this).addClass('box-selected') does not change the background of the currently clicked element. any ideas? TIA

    Read the article

1