1) Script Title: iFrame Button Replace
2) Script URL (on DD):http://www.dynamicdrive.com/dynamici...ndomiframe.htm
3) Describe problem: How can I replace the default button with my own design?
1) Script Title: iFrame Button Replace
2) Script URL (on DD):http://www.dynamicdrive.com/dynamici...ndomiframe.htm
3) Describe problem: How can I replace the default button with my own design?
What button?
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
The "Ping" button that appears when a new random page is selected.
Here is an example: http://www.kabubble.com/pingxit_news.htm
Ry
That button has nothing really to do with the script. Here is the code for that button on that page:
The:HTML Code:<input type="button" value=" PING " onclick="window.location.reload()" style="color: #2E3192; font-weight: bold; font-family: Verdana; font-size:12pt">
is the text displayed, the style can be whatever style you like and, as you can see, all it does when you click on it is reload the page. When this happens, most browsers will also rerun any scripts on the page.Code:value=" PING "
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
I see but what I want to do is to substitute a button image - .gif or jpeg. Not sure how to do this...
It depends upon if you want an image button:
or an image as a link:HTML Code:<input type="image" src="mybut.gif" onclick="window.location.reload();">
HTML Code:<a href="#" onclick="window.location.reload();return false;"><img src="mybut.gif" border="0"></a>
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thanks John, your button solution worked. Since you know this coding, do you have an answer to my previously posted question:
"Is there a way to access the URL of the (randomly) selected page? For example, click a button and the URL of the displayed page is accessed."
Thanks, Ry
If I understand correctly, sure:
By the way, this script is not rated for Opera but, it works fine in that browser if you let it by changing this:HTML Code:<input type="image" src="mybut_2.gif" onclick="window.location.href=document.all? document.all.dynstuff.src : document.getElementById('dynstuff').src;">
to:Code:var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1 var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
Code:var ie=document.all var dom=document.getElementById
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
does someone now how to change the borders in the iframe?
I think you mean the border of the iframe. Do you? If so, you can specify the standard iframe border simply by using the script as is. If you wish no borders, change the frameborder attribute below to 0:
For a custom styled border, use 0 in the above and put this style section in the head of the page:Code://Specify IFRAME display attributes var iframeprops='width=130 height=130 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'
You can use any valid border styling you like in it.Code:<style type="text/css"> #dynstuff { border:1px solid red; } </style>
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks