1 Replies - 667 Views - Last Post: 23 October 2012 - 06:07 AM

#1 Yassine Houssni   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-October 12

Image visualizations with jQuery

Posted 23 October 2012 - 05:43 AM

Can someone help me with this? I have a menu-slider and everytime you hover on a list-item a new image shows up, the problem is: Everytime a new image shows up it loads up, and after that it follows my code, so, the image shows up, and then it hides, and then it fades in but I want the image to get hidden before it even shows up.

My code:

<script type="text/javascript">
$('#image_div').prepend(
	$('<img/>',{}).load(
		function(){
			$(this).hide().delay(500).fadeIn(1000);
			$('#image_div img:first').next().animate({},0,function(){
				$(this).remove();
			});
		}
	).attr('src',''+info_elem.find('.info_image').html())
);
</script>



Thanks in advance.

P.S. this is just a small part, I didn't paste the whole code because I think it is unnecessary.

Is This A Good Question/Topic? 0
  • +

Replies To: Image visualizations with jQuery

#2 Yassine Houssni   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-October 12

Re: Image visualizations with jQuery

Posted 23 October 2012 - 06:07 AM

EDIT:

changed: $('<img/>',{}).load(
into: $('<img class="hidden" />',{}).load(

and I added this in the css: .hidden {display: none;}
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1