View Single Post
Old 10-05-2012, 09:06 PM   PM User | #12
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
Code:
function loadDivHTML(div_id, content_src)
{
	$("#" + div_id).load(content_src, bookmark);
	setGlossLinkListeners(); //Each time new content is loaded this function sets listeners on PU links.
}
remove the code in orange.


change this
Code:
function setGlossLinkListeners()
{
	/*$('#contentContainer a.glossaryLink').each(function() { 
		alert('this will alert for every li found.'); 
	}); */

	$('#contentContainer a.glossaryLink').on('hover', function(){
			onRollOverPULink();
	});
	/*$('a.glossaryLink').live("hover", function(event){
		alert("WTF");
	});
	.onmouseout(function(event){;
		onRollOutPULink(event);
	}).click(function(event){
		showHideGlossary();
	})*/
}
to this

Code:
$(document).ready(function(){

	$('a.glossaryLink').on('mouseover', function(){
		alert("you hovered on a glossary link);
	}).on('mouseout',function(event){
		onRollOutPULink(event);
	}).on('click',function(event){
          event.preventDefault();
		showHideGlossary();
	})
});
and see if that works
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote