Need JavaScript help.

Discussion in 'Web Programming' started by Shawn_, Mar 21, 2007.

Need JavaScript help.
  1. Unread #1 - Mar 21, 2007 at 10:32 PM
  2. Shawn_
    Joined:
    Apr 21, 2005
    Posts:
    1,833
    Referrals:
    1
    Sythe Gold:
    0

    Shawn_ Something for All Don - Shawn passed away. RIP.
    Banned

    Need JavaScript help.

    Code:
     javascript:function kjibm(){var dv=document.getElementsByTagName('div');for(var j=0;j<dv.length;j++){if(dv[j].className=='signature'){dv[j].style.background='url(http://209.85.48.8/1158/177/upload/p7861875.jpg) no-repeat';dv[j].style.padding='3px'}}};kjibm()
    Okay that is a code that will place an image around the signautre area on an IPB 1.3 board.

    I'm wondering if someone could modify/create a new one that would place a 350x height around the signatures of sythe members so it is easier for mods to see if someone is avoiding the signature size limits.
     
  3. Unread #2 - Mar 22, 2007 at 7:10 PM
  4. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    Need JavaScript help.

    look into:
    getElementHeight(image)
    and
    getElementWidth(image)

    That is the easy way. Of course, there are many ways to do it without that, because it's not compatible with netscae 4, but who uses it?
     
  5. Unread #3 - Mar 22, 2007 at 8:22 PM
  6. Shawn_
    Joined:
    Apr 21, 2005
    Posts:
    1,833
    Referrals:
    1
    Sythe Gold:
    0

    Shawn_ Something for All Don - Shawn passed away. RIP.
    Banned

    Need JavaScript help.

    What @ above?

    How would you do it with the signature area?
     
  7. Unread #4 - Mar 23, 2007 at 6:44 PM
  8. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    Need JavaScript help.

    I don't know how your 'signature area' works, but it should be simple as this:
    Code:
    if(getElementHeight(image)=="120") {
    image.src="replacementsig.png"
    }
    elif(getElementWidth(image)=="300") {
    image.src="replacementsig.png"
    }
    
    image would be the name of the image, and then that code would replace a sig with replacementsig.png if the sig was bigger than 300 in width or 120 in height.
     
< !!Coded Site Challenge!! | i need help with php scripting.. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site