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

   Image Repeat to Del.icio.us Add to del.icio.us
  Digg Image Repeat Digg it
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: 25429
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 Online   shocked
Wizard

Registered: 01/10/00
Posts: 5122
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


Who's Online
0 Registered (), 41 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by AllenAyres
Today at 02:05 PM
What do you use to edit the files
by Ian_W
10/05/08 03:33 PM
BeyondCompare v3.00
by Ian_W
10/05/08 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
10/05/08 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3] Language file checker
by blaaskaak
09/09/08 12:56 AM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
pisa666, ghengis317, NitroX, Dogan, EliYah-
13345 Registered Users
Top Posters Last 30 Days
AllenAyres 18
blaaskaak 12
FREAK1 7
Mike L_dup1 4
Chris Bale 4
Ian_W 4
tackaberry 4

 

 

 
fusionbb message board php hacks