Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: iFrame button replace

  1. #1
    Join Date
    May 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default iFrame button replace

    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?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    What button?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The "Ping" button that appears when a new random page is selected.

    Here is an example: http://www.kabubble.com/pingxit_news.htm

    Ry

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That button has nothing really to do with the script. Here is the code for that button on that page:

    HTML Code:
    <input type="button" value="         PING         " onclick="window.location.reload()" style="color: #2E3192; font-weight: bold; font-family: Verdana; font-size:12pt">
    The:

    Code:
    value="         PING         "
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I see but what I want to do is to substitute a button image - .gif or jpeg. Not sure how to do this...

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It depends upon if you want an image button:

    HTML Code:
    <input type="image" src="mybut.gif" onclick="window.location.reload();">
    or an image as a link:

    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

  7. #7
    Join Date
    May 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If I understand correctly, sure:

    HTML Code:
    <input type="image" src="mybut_2.gif" onclick="window.location.href=document.all? document.all.dynstuff.src : document.getElementById('dynstuff').src;">
    By the way, this script is not rated for Opera but, it works fine in that browser if you let it by changing this:

    Code:
    var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
    var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
    to:

    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

  9. #9
    Join Date
    Nov 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    does someone now how to change the borders in the iframe?

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by userkef1992 View Post
    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:

    Code:
    //Specify IFRAME display attributes
    var iframeprops='width=130 height=130 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'
    For a custom styled border, use 0 in the above and put this style section in the head of the page:

    Code:
    <style type="text/css">
    #dynstuff {
    border:1px solid red;
    }
    </style>
    You can use any valid border styling you like in it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •