Previous Thread
Next Thread
Print Thread
Rate Thread
#110002 04/30/2006 7:17 AM
Joined: Jan 2006
Posts: 11
Junior Member
Junior Member
Offline
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);
}
}

Sponsored Links
#110003 04/30/2006 7:39 PM
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?


- Allen wavey
- What Drives You?
#110004 05/01/2006 1:30 AM
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...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
#110005 05/01/2006 9:46 AM
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.)

Code
// 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:

Code
if (typeof s == 'object') {
for(key in s) document.writeln(key+':'+s[key]);
}

#110006 05/01/2006 10:42 AM
Joined: Jan 2006
Posts: 11
Junior Member
Junior Member
Offline
Joined: Jan 2006
Posts: 11
well this is Javascript , may apologizes for not stating that

this is a compleate version of the code.


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 tipsy ]


thanks for your responses. smile

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)