php forum
php mysql forum
php mysql smarty
 
Topic Options
#110002 - 04/30/06 07:17 AM Image Repeat
Raziel Offline
Junior Member

Registered: 01/22/06
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);
}
}

Top
#110003 - 04/30/06 07:39 PM Re: Image Repeat
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25365
Loc: Texas
what language is that? perl? php?
_________________________
- Allen wavey
- What Drives You?

Top
#110004 - 05/01/06 01:30 AM Re: Image Repeat
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5091
Loc: Portland, OR, USA
Javascript I'm assuming...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#110005 - 05/01/06 09:46 AM Re: Image Repeat
Burak Offline
Addict

Registered: 05/29/00
Posts: 1820
Loc: Istanbul, Turkey
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]);
}
_________________________
one bytecode to rule them all

Top
#110006 - 05/01/06 10:42 AM Re: Image Repeat
Raziel Offline
Junior Member

Registered: 01/22/06
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

Top


Top Posters Last 30 Days
AllenAyres 83
Gizmo 28
Zarzal 21
sirdude 19
blaaskaak 14
willing 7
swebs 6
Who's Online
0 Registered (), 46 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
[7.3.x] ubb.links
by AllenAyres
Yesterday at 06:15 PM
Changing currency for subscriptions?
by AllenAyres
Yesterday at 01:15 PM
Protect users emails
by AllenAyres
Yesterday at 11:36 AM
VPS and Newbies
by Gizmo
07/02/08 09:08 PM
Team UBBDev Rides Again!
by AllenAyres
07/02/08 11:38 AM
Drupal / UBB integration module for Drupal
by blaaskaak
06/30/08 01:52 PM
[7.3.x] Scheduled board close for backup
by AllenAyres
06/30/08 12:51 PM
New Mods
Protect users emails
by Basil Fawlty
06/29/08 08:44 AM
[7.3.x] Scheduled board close for backup
by blaaskaak
06/26/08 04:01 AM
[7.3+] CustomTag - Audo Embedding
by Gizmo
06/24/08 07:52 PM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.3] Dissallow quotes more then 3 levels deep
by blaaskaak
06/09/08 09:01 AM
Newest Members
ryzilla, M4D, Jer, Kanigo2, Bubba
13302 Registered Users

 

 

 
fusionbb message board php hacks