Jump to content

Recommended Posts

the script shows an alternative image on mouse over using the rel atribute the second part takes a hidden div and shows the content in another place on the same page but when i hover the image the image doesn't change, the hover on the hidden div works, but after moving it on click in other place the hover doesn't work in the new place. I think it might be the document ready script because i alter the page after ready but i'm not sure, any advise? thank you

$(document).ready(function(){
$(function() {
	$('img[rel]').hover(function() {
		$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('rel')).attr('rel', $(this).attr('tmp')).removeAttr('tmp');
	}).each(function() {
		$('<img />').attr('src', $(this).attr('rel'));
	});
	$('.id2').one("click",function() {
		 var newPara = $('#test').html();
		$('#big_photo').append(newPara);
	});	
});
});

Link to comment
https://forums.phpfreaks.com/topic/248084-hover-image-not-working-after-html/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.