• Its a great plugin.I was looking for something like this for some time now.

    I have placed a button on my homepage and has written the javascript code in your js editor.

    But, the code is not taking effect. Not sure what wrong.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Tiny Code

    (@tinycode)

    Could you show me your js code?

    In current version, please don’t use // comment style; use jQuery instead of $. I hope it will help you.

    If your code still not working, please contact me: tinycodestudio@gmail.com

    Thread Starter ntanwir10

    (@ntanwir10)

    Hi,

    Sure. This is my js code.

    function myImg(){
      window.name = "thiswin";
      newwin=open("https://185.105.4.132/~zen/player/zenradio.html", "dispwin",
                  "width=750,height=300,scrollbars=no, menubar=no");
    }

    This code is to open the link in a new window.

    Plugin Author Tiny Code

    (@tinycode)

    function myImg(){
      window.name = "thiswin";
      newwin = window.open("https://185.105.4.132/~zen/player/zenradio.html", "dispwin",
                  "width=750,height=300,scrollbars=no, menubar=no");
    }

    I modified your code, please try it.

    Thread Starter ntanwir10

    (@ntanwir10)

    Still. no success.

    Plugin Author Tiny Code

    (@tinycode)

    Could you give me your website link? If you do not want to public it, you can send to my email: tinycodestudio@gmail.com

    Thread Starter ntanwir10

    (@ntanwir10)

    Plugin Author Tiny Code

    (@tinycode)

    You should add onclick=”myImg()” to the button. Like this:
    <a onclick="myImg()" href="javascript:void(0);" target="_self" class="gdl-button small" style="color:#fff; background-color:#ff7000; border-color:#cc5a00; ">LISTEN HERE</a>
    I use href=”javascript:void(0);” instead of URL to prevent browser go to that URL.

    Thread Starter ntanwir10

    (@ntanwir10)

    <p style=”text-align: center;”>[button color=”#fff” background=”#ff7000″ size=”small” onclick=”myImg()” href=”javascript:void(0);” src=”https://185.105.4.132/~zen/player/zenradio.html&#8221; target=”_blank”]LISTEN HERE[/button]</p>

    This is my button code.

    Plugin Author Tiny Code

    (@tinycode)

    I see… You have to add ID to the button, and then use jQuery to set onclick action. Change your button to:
    <p style="text-align: center;">[button color="#fff" background="#ff7000" size="small" id="listenhere" src="javascript:void(0);" target="_self"]LISTEN HERE[/button]</p>

    then add this to Custom Javascript:

    function myImg(){
      newwin = window.open("https://185.105.4.132/~zen/player/zenradio.html", "dispwin", "width=750,height=300,scrollbars=no, menubar=no");
    }
    
    jQuery('#listenhere').click(myImg());

    Thread Starter ntanwir10

    (@ntanwir10)

    nothing is happening. Button is not working.

    Plugin Author Tiny Code

    (@tinycode)

    Change JS to below code, notice the ; (semicolon) after myImg function.

    function myImg(){
      newwin = window.open("https://185.105.4.132/~zen/player/zenradio.html", "dispwin", "width=750,height=300,scrollbars=no, menubar=no");
    };
    
    jQuery('body.home .gdl-button').click(myImg());

    and make sure your browser allows popup (very important if you want to open in new window).

    Thread Starter ntanwir10

    (@ntanwir10)

    nope. still doesn’t work.

    Plugin Author Tiny Code

    (@tinycode)

    function myImg(){
      newwin = window.open("https://185.105.4.132/~zen/player/zenradio.html", "dispwin", "width=750,height=300,scrollbars=no, menubar=no");
    };
    
    jQuery('body.home .gdl-button').click(function() { myImg(); });

    Please copy exactly this code. body.home and .gdl-button have spacebar between

    Thread Starter ntanwir10

    (@ntanwir10)

    yes, thats exactly what I was doing.

    anyway, it works now.

    Plugin Author Tiny Code

    (@tinycode)

    Thank god, It works, haha.
    Today I’m feeling so confused, made too many mistakes. Sorry for wasting your time ??

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘js code not working.’ is closed to new replies.