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: 25411
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: 5119
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 13
Gizmo 10
willing 2
S7ARBVCK 2
MattUK 1
Kevin H 1
tackaberry 1
Who's Online
0 Registered (), 21 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Noob - need help, or a reality check!
by Gizmo
Yesterday at 03:21 AM
Here I am! Rock me like a Hurricane!
by AllenAyres
09/02/08 03:05 PM
[7.x] Generic Page Outside of forum directory
by Gizmo
08/30/08 05:43 PM
Team UBBDev Rides Again!
by Gizmo
08/28/08 11:45 PM
Multiple Identity Detector
by MattUK
08/28/08 04:10 PM
[7.3.x] ubb.links
by AllenAyres
08/26/08 09:57 AM
Installing FlashChat with 7.3
by Gizmo
08/23/08 05:36 AM
New Mods
Installing FlashChat with 7.3
by Paug
08/23/08 12:14 AM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
veedubb8, twentyseven, Claus1, welcomeback1, Paug
13327 Registered Users

 

 

 
fusionbb message board php hacks