1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone that can help me with CSS/Javascript? Please.

Discussion in 'HTML & JavaScript' started by MicGrez, Feb 20, 2014.

  1. MicGrez

    MicGrez Regular Member

    Joined:
    Aug 11, 2011
    Messages:
    333
    Likes Received:
    103
    I have trying to fix this for like 2hours now...

    Code:
    if ( $.cookie("fb-lk") && $.cookie("fb-sh") ) {      $("#multistep-proceed").fadeTo(300, 1).prop("disabled", false).attr("onClick", "loadGTW()");
        }
      } multistep_check();
    
    
      function loadGTW () {
        alert('downloadbutton');
      }
    
    
      // <-
      </script>
    The function loadGTW is somehow supposed to load my content locker on click. But I just get an alert.. The content locker has a css trigger called .downloadbutton

    Anyone knows how to get this going? I have the content locker code in the header..

    <script type="text/javascript"
    src="http://XXXX.XXX/tyf4g4/locker.js?guid=44fe77af7dd7b265">
    </script>
     
  2. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,148
    According to the code you pasted, that 's the only thing it does - display an alert.
     
  3. MicGrez

    MicGrez Regular Member

    Joined:
    Aug 11, 2011
    Messages:
    333
    Likes Received:
    103
    haha, what can I do to make it call my javascript code? :S
     
  4. phr0zt

    phr0zt Regular Member

    Joined:
    Jun 30, 2007
    Messages:
    439
    Likes Received:
    182
    The reason you're getting an alert is because you're calling "alert" in the loadGTW() function. You'll never show content that way, just a popup with text.

    Without seeing more of the code, I'm not sure what to tell you, but that's the source of the problem. You need to call something else to show the .downloadbutton class (or whatever you're trying to show - a button, the locker gateway itself, etc.) - .show() (jQuery) comes to mind, but that may not be correct for the locker
     
  5. MicGrez

    MicGrez Regular Member

    Joined:
    Aug 11, 2011
    Messages:
    333
    Likes Received:
    103
    hmm okay. I am basically just trying to trigger the css selector for my locker.

    [​IMG]

    The script ends like this:

    530bfc53f033e1ec53aca5435168e486.png

    The button that get enabled should call javascript onclick.

    6242595fbc9357015f3c102792409136.png
     
  6. solventnine

    solventnine Junior Member

    Joined:
    Dec 4, 2009
    Messages:
    113
    Likes Received:
    16
    The enabled button will call onclick() if you're passing something to that function.

    As was already mentioned, calling alert('downloadbutton') is only going to fire an alert pop-up that says "downloadbutton."

    So if you have
    Code:
    <!-- XHMTL -->
    <input type="button" name="enable_me" value="Click to Proceed" />
    <!-- or HTML5 -->
    <button name="enable_me">Click to Proceed</button>
    
    you still need to add the "onclick" function:

    Code:
    <!-- XHMTL -->
    <input type="button" name="enable_me" value="Click to Proceed" onclick="loadGTW();" />
    <!-- or HTML5 -->
    <button name="enable_me" onclick="loadGTW();">Click to Proceed</button>
    
    BUT...that won't fix your alert problem. You're going to have to modify loadGTW() to do whatever it is you want to run (I'm assuming that's your content locking).
     
    • Thanks Thanks x 1