|
|
|
Joined: Jan 2006
Posts: 11
Junior Member
|
Junior Member
Joined: Jan 2006
Posts: 11 |
does anyone know how i can edit this code so that , if the page is stretched, the image appended would repeate ?
function headBase(theTable){ var pTD = theTable.parentNode; if(pTD.firstChild.nodeName == "DIV"){ return false; } var hDiv = document.createElement("div"); hDiv.align = "center"; var hImg = new Image(); hImg.src = headImg; hDiv.appendChild(hImg); var bDiv = hDiv.cloneNode(true); bDiv.firstChild.src = baseImg; pTD.insertBefore(hDiv, theTable); if(theTable.nextSibling){ pTD.insertBefore(bDiv, theTable.nextSibling); }else{ pTD.appendChild(bDiv); } }
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
what language is that? perl? php?
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Javascript I'm assuming...
|
|
|
|
Joined: May 2000
Posts: 1,356
Addict
|
Addict
Joined: May 2000
Posts: 1,356 |
all css properties can be modified via js, but notation is different (background-repeat is backgroundRepeat etc.) // foo is <td id="foo"> var o = document.getElementById('foo'); var s = o.style; s.background = "url('a.gif')"; s.backgroundRepeat = "repeat"; in your code, I think that "o" is "bDiv.firstChild" ... You can probe any object to see it's properties: if (typeof s == 'object') { for(key in s) document.writeln(key+':'+s[key]); }
|
|
|
|
Joined: Jan 2006
Posts: 11
Junior Member
|
Junior Member
Joined: Jan 2006
Posts: 11 |
well this is Javascript , may apologizes for not stating that this is a compleate version of the code. var baseImg = "BASE IMAGE URL"; var headImg = "HEAD IMAGE URL";
function headBase(theTable){ var pTD = theTable.parentNode; if(pTD.firstChild.nodeName == "DIV"){ return false; } var hDiv = document.createElement("div"); hDiv.align = "center"; var hImg = new Image(); hImg.src = headImg; hDiv.appendChild(hImg); var bDiv = hDiv.cloneNode(true); bDiv.firstChild.src = baseImg; pTD.insertBefore(hDiv, theTable); if(theTable.nextSibling){ pTD.insertBefore(bDiv, theTable.nextSibling); }else{ pTD.appendChild(bDiv); } }
var iTable = document.getElementsByTagName("table"); if(location.href.match(/com|index.cgi/)){ for(t=4; t<iTable.length; t++){ if(iTable[t].width == "100%" && iTable[t].className == "bordercolor"){ headBase(iTable[t]); } } } you see it add an image above a table, for forums, like over here thier is an image between each catagory, only in this case its one image. I want the image added above and below(head/base)to repeate, its not exaclty a background. [add the script tags acordingly , i cant add them it doesnt let me ] thanks for your responses.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 5,833
Joined: January 2000
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|
|
|