Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: can't get array

  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    85
    Thanks
    13
    Thanked 1 Time in 1 Post

    can't get array

    I'm wondering why I'm not getting an array of anchors here

    nevermind. I solved this. thanks anyway

    Code:
     //$('#swiffy-braces-diagram').html("<img src='/assets/uploads/images/brace-painter.png'/>");
    			  	 $('#swiffy-braces-diagram').css('background-image', "url('/assets/uploads/images/brace-painter.png')")
    					 .append("<a href='' id='elastic-tie'>")
    					 .append("<a href='' id='loop-in-archwire'>")
    					 .append("<a href='' id='archwire'>")
    					 .append("<a href='' id='bracket'>")
    					 .append("<a href='' id='headgear-tube'>")
    					 .append("<a href='' id='coil-spring'>")
    					 .append("<a href='' id='tie-wire'>")
    					 .append("<a href='' id='band'>")
    					 .append("<a href='' id='hook'>")
    					 .append("<a href='' id='elastic'>")
    					 .append("<div id='description'>");
    				 });
    				
    				if( $('#swiffy-braces-diagram a').length == 0){alert('some'); //this shouldn't do anything but it does }
    				
    				$('#swiffy-braces-diagram a').each( function(i){
    					$(this).mouseover( function(){
    						$('#swiffy-braces-diagram #description').html( description[i] );
    					});
    				});
    thank you
    Last edited by footballer27; 09-22-2012 at 12:34 AM. Reason: solved

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,146
    Thanks
    38
    Thanked 505 Times in 499 Posts

    Exclamation

    Quote Originally Posted by footballer27 View Post
    I'm wondering why I'm not getting an array of anchors here

    nevermind. I solved this. thanks anyway

    Code:
     //$('#swiffy-braces-diagram').html("<img src='/assets/uploads/images/brace-painter.png'/>");
    			  	 $('#swiffy-braces-diagram').css('background-image', "url('/assets/uploads/images/brace-painter.png')")
    					 .append("<a href='' id='elastic-tie'>")
    					 .append("<a href='' id='loop-in-archwire'>")
    					 .append("<a href='' id='archwire'>")
    					 .append("<a href='' id='bracket'>")
    					 .append("<a href='' id='headgear-tube'>")
    					 .append("<a href='' id='coil-spring'>")
    					 .append("<a href='' id='tie-wire'>")
    					 .append("<a href='' id='band'>")
    					 .append("<a href='' id='hook'>")
    					 .append("<a href='' id='elastic'>")
    					 .append("<div id='description'>");
    				 });
    				
    				if( $('#swiffy-braces-diagram a').length == 0){alert('some'); //this shouldn't do anything but it does }
    				
    				$('#swiffy-braces-diagram a').each( function(i){
    					$(this).mouseover( function(){
    						$('#swiffy-braces-diagram #description').html( description[i] );
    					});
    				});
    thank you
    As long as you posted the question, how about posting your solution too!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •