Skip to content Skip to sidebar Skip to footer

How To Use Two $.post Methods Very Well

function ChangeGallery(){ var GalleryName = $('.SubSubGalleryLock').text(); /*Send string to Data1.php and include Tags from Database*/ $.post('Data1.php', { Section

Solution 1:

You're trying to access to the element as by class name, you should do it by id:

$('#Chosen_DIV').mouseover(function() {
    //SomeCodes
})
$('#Chosen_DIV').mouseout(function() {
    //SomeCodes
})

this should work

Solution 2:

Chosen_DIV is a ID, not class. So

$('#Chosen_DIV').mouseover(function() {
    //SomeCodes
})
$('#Chosen_DIV').mouseout(function() {
    //SomeCodes
})

It has to be '#' not '.'

Solution 3:

jQuery won't bind to new elements added to the DOM after being called unless you rebind after they've been added or you bind to the parent element initially:

$("#Chosen_Div-parent").on("mouseover", ".Chosen_Div", function(event){
  //Some codes
});

(If you're ever going to have more than one Chosen_Div element, use classes instead of ids)

Read the docs

Post a Comment for "How To Use Two $.post Methods Very Well"