Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Unhappy All I want is a clickable link, not an InputType = _____?!

    Hi there, thanks for stopping by.
    This is probably the stupidest question in the history of questions, but all I want is a clickable link, not an Input type=Text/Button/Checkbox. It's so frustrating because my knowledge is so limited and I know theres a pisseasy answer right around the corner. It's a toggle fullscreen link, but I don't want it to be a button.

    Here is what I have



    <head>

    <script type="text/javascript">
    function toggleFullScreen() {
    if ((document.fullScreenElement && document.fullScreenElement !== null) ||
    (!document.mozFullScreen && !document.webkitIsFullScreen)) {
    if (document.documentElement.requestFullScreen) {
    document.documentElement.requestFullScreen();
    } else if (document.documentElement.mozRequestFullScreen) {
    document.documentElement.mozRequestFullScreen();
    } else if (document.documentElement.webkitRequestFullScreen) {
    document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
    }
    } else {
    if (document.cancelFullScreen) {
    document.cancelFullScreen();
    } else if (document.mozCancelFullScreen) {
    document.mozCancelFullScreen();
    } else if (document.webkitCancelFullScreen) {
    document.webkitCancelFullScreen();
    }
    }
    }
    </script>


    </head>


    <body>

    <input type="button" value="First Time?" onclick="toggleFullScreen()">

    </body>


    All I want is for the text to be a link, not a button.

    Thanks so much

  • #2
    New Coder
    Join Date
    Oct 2012
    Location
    VA,USA
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    HI!!
    If you want to use "text" as a link. The code below is what you need "href" is the url you are linking to, and the "target" can be changed on how you want the link to open(in the same tab, new tab, or new window).

    Code:
    <a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
    if you want it to open in the same tab then just take out the "target", so it will look like this.

    Code:
    <a href="http://www.w3schools.com/">Visit W3Schools!</a>
    Hope this will work for you!!
    bigcoder

    P.S.
    I use http://www.w3schools.com a lot for all my problems.

  • #3
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    Ok ... you should quickly learn some HTML basics
    Code:
    <a href="#" onclick="toggleFullScreen(); return false;">First Time?</a>

  • Users who have thanked devnull69 for this post:

    Shaqcoulter (10-11-2012)

  • #4
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts
    You, my friend, are a genius. Hahah I love you!

    This is for my Tumblr. I've been looking into ways that allow me to get the viewer to enter fullscreen mode, because I think the blog looks better that way.
    what this code does is put the user into full screen on the home page, but exits as soon as a link is pressed.
    If you have any ideas about allowing the user to stay in Full screen all throughout the site, or be maybe forced into Fullscreen on entry (esc to exit if need be), do you reckon you could help me on this front? I've been looking into here

    http://stackoverflow.com/questions/1...ver-the-screen

    But none of the coding seems to work. Any ideas buddy?
    But thanks again, you're a genius.

    By the way: you can place javascript files into tumblr, but none of the three best codes seemed to work. Maybe i'm just doing it wrong.

  • #5
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,703
    Thanks
    0
    Thanked 233 Times in 228 Posts
    Hi there Shaqcoulter,

    try it like this...
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title>First Time?</title>
    <style type="text/css">
    #firstTime {
        width:100px;
        margin:auto;
        cursor:pointer;
        text-align:center;
     }
    #firstTime:hover {
        color:#f00;
     }
    </style>
    
    <script type="text/javascript">
    
    function toggleFullScreen() {
    if((document.fullScreenElement && document.fullScreenElement!== null)||
      (!document.mozFullScreen && !document.webkitIsFullScreen)) {
    if(document.documentElement.requestFullScreen) {
       document.documentElement.requestFullScreen();
     } 
    else {
    if(document.documentElement.mozRequestFullScreen) {
       document.documentElement.mozRequestFullScreen();
     } 
    else { 
    if(document.documentElement.webkitRequestFullScreen) {
       document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
    } 
    else {
    if(document.cancelFullScreen) {
       document.cancelFullScreen();
    } 
    else {
    if(document.mozCancelFullScreen) {
       document.mozCancelFullScreen();
    } 
    else {
    if(document.webkitCancelFullScreen) {
       document.webkitCancelFullScreen();
            }
           }
          }
         }
        }
       }
      }
     }
    
    function init(){
    document.getElementById('firstTime').onclick=function() {
       toggleFullScreen();
      }
     }
    
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    </script>
    
    </head>
    <body>
    
    <div id="firstTime">First Time?</div>
    
    </body>
    </html>
    
    coothead


  •  

    Tags for this Thread

    Posting Permissions

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