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
    Regular Coder
    Join Date
    Dec 2006
    Posts
    177
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Why am I such a noob?

    I have no idea why this line of code isn't working--
    http://vanishingpoint.b1.jcink.com/i...p?showtopic=14 (not advertising here lol)

    I want to give .tableborder the id topictext for that page but it doesn't seem to be working
    I can't edit the html template because it's a sad free forum host l0l

    anywho this is the line of code that doesn't work
    if it works the entire .tableborder shouldnt show because I had it set to display:none in my css
    Code:
    $("div.tableborder").hasClass("postlinksbar").attr("id","topictext");
    the entire script
    Code:
    <script type="text/javascript">
    if($("#userlinks td:contains('Welcome Guest')").length>0){
    $("#userlinks td:contains('Welcome Guest')").wrapInner("<div id='lag1'></div>").html($("#userlinks td:contains('Welcome Guest')").html().replace(/Guest/, '<span class="guestbx">Guest</span>'));
    }
    $("div#lag1").insertBefore("#logostrip");
    $("#navstrip").html($("#navstrip").html().replace(/&nbsp;/, '')).html($("#navstrip").html().replace(/Log In/, "<div id='navtext'>Login</div>"));
    $("#menux a:last").attr("id","sadfix");
    $("div#navstrip a:first-child").attr("id","original");
    $("#menux a:last").hover(
    function()
    {$("div#stupidpad").css("background-image","url('http://vanishingpoint.b1.jcink.com/uploads/vanishingpoint//23125i.png')");}
    ,function()
    {$("div#stupidpad").css("background-image","url('http://vanishingpoint.b1.jcink.com/uploads/vanishingpoint//23125g.png')");}
    );
    $("table").removeAttr("cellpadding").removeAttr("cellspacing").removeattr("border");
    $("td.row2[nowrap]").addClass("postinfo");
    $("div.tableborder").hasClass("postlinksbar").attr("id","topictext");
    </script>

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    first of all you have an error on line 593 - you didnt capitilize the A

    Code:
    $("table").removeAttr("cellpadding").removeAttr("cellspacing").removeattr("border");

  • #3
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    Code:
    $("div.tableborder").hasClass("postlinksbar").attr("id","topictext");
    is not working becuase this does not match your html structure.

    this line basically says find the div that has a class ov tableborder and also has a class of postlinksbar.

    in your html postlinksbar is inside of a div with a class of tableborder

    so if you wan to set the id of that div to "topictext"

    then :

    Code:
    $("div.tableborder > .postlinksbar").attr("id","topictext");
    and your a noob becuase you are learning, don't be so hard on yourself . So please read the posting rules in regards to subject titles. " im a noob" doesnt help much


  •  

    Posting Permissions

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