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 3 of 3
  1. #1
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts

    creating divs not working

    Hi all, im trying to select certain elements from on screen and set the style of a div to over lap it.

    Code:
    $("body *").each(function(){
    	if($(this).attr("rel")!="nbta"){
    		alert("#div" + z + " style: " + "display:block; width:" + $(this).width() + "px; height:" + $(this).height() + "px; position:absolute; top:" + $(this).position().top + "px; left:" + $(this).position().left + "px; border: 1px solid red; z-index:" + $(this).parentNumber() + ";");
    			
    		$("#div" + z).attr("style", "display:block; width:" + $(this).width() + "; height:" + $(this).height() + "; position:absolute; top:" + $(this).position().top + "; left:" + $(this).position().left + "; border: 1px solid red; z-index:" + $(this).parentNumber() + ";"); 
    		z++;
    	}
    });
    Code:
    <p id="fooBar">dfgdsfdsfdsf1111</p>
    <p id="fooBar2">dfgdsfdssdsdfdsf222</p>
    <p id="fooBar3">dfgdsfdsfdsf333</p>
    <p id="fooBar4">dfgdsfdsfdsf444</p>
    
    <div id="div1" style="display:none" rel="nbta">&nbsp;</div>
    <div id="div2" style="display:none" rel="nbta">&nbsp;</div>
    <div id="div3" style="display:none" rel="nbta">&nbsp;</div>
    <div id="div4" style="display:none" rel="nbta">&nbsp;</div>
    seems easy enough and the results are showing corrent i just cant seem to get it to display!
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    hmmm firebug seems to show:

    Code:
    <div id="div1" rel="nbta" style="border: 1px solid red; display: block; position: absolute; top: 0pt; left: 0pt; z-index: 1;"> </div>
    <div id="div2" rel="nbta" style="border: 1px solid red; display: block; position: absolute; left: 0pt; z-index: 1;"> </div>
    <div id="div3" rel="nbta" style="border: 1px solid red; display: block; position: absolute; left: 0pt; z-index: 1;"> </div>
    <div id="div4" rel="nbta" style="border: 1px solid red; display: block; position: absolute; left: 0pt; z-index: 1;"> </div>
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #3
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    sorted it... changed it to single quotes.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 


  •  

    Posting Permissions

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