SuperFly Function

Hello, i want to launch this code on a button in superfly:

<a target="_blank" onclick="window.open('http://shofarmessiah.wixsite.com/shofar-messiah-radio','popUpWindow','height=560,width=1020,left=500,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=middle,directories=no, status=no');"
onmouseover="document.sub_but.src='https://shofar-messiah.com/wp-content/uploads/2018/01/RADIOMY2.gif'" onmouseout="document.sub_but.src='https://shofar-messiah.com/wp-content/uploads/2018/01/RADIOMY.gif'">
<img src='https://shofar-messiah.com/wp-content/uploads/2018/01/RADIOMY2.gif' style="width:200px; height:110px; border:0px solid #cc3300;" alt="Move your mouse over me" name="sub_but">
</a><!–end_raw–>

it opens a popup window with a link.
is it possible to do that in superfly?
and if no, then can i make this whole code as a function Class or CSS?

Hi @angelofgod,

Thanks for posting in.

You mean as a menu item in SuperFly? You could do that, by going to Admin > Appearance > Menus and click the SF icon in your target menu item. Then add your code to Custom HTML OR shortcode input field.

Thanks!

hey,

nope, it doesnt work.
says the link to this button is #

Hi there,

You have to turn on the sub-menu panel first. I went ahead and did it in Advanced setting section of SuperFly.

Thanks!

1 Like

Hi thanks!

But it seems whenever i add a shortcode or convertplus shortcode the superfly menu does not appear. what could cause the problem?

Hi,

Could you please mention which menu item exactly you want to have this effect with? also on which page exactly you are displaying this menu?

Thanks.

1 Like

its ok i manage to do this with JS code
i have added in X > theme options > JS:
jQuery(function($) {
$( “.sfm-menu-item-3246” ).on( “click”,function() {
$(’.Temper’).click();
});
});

the “.sfm-menu-item-3246” is the clicked class (id)
and the “.Temper” is that class that is launched when the first one was clicked.

My question is how exacly do i launch a html or java script code when a class is being clicked.

what i want is to launch a new window with specific size and with no scroll, for example

=

When class .blabla is being clicked
then open new window size of heigh 200 width 500 no scroll link=www.text.com

how can i achieve this please?

Hi,

I can list some resources for you to learn how to achieve this customization, please check these tutorials:

https://www.w3schools.com/jsref/met_win_open.asp

I hope you find them helpful!
Thanks.

1 Like

i have made this code

jQuery(function($) {
$(".sfm-menu-item-3246").click(function () {
var w = window.open("", “popupWindow”, “width=600, height=400, scrollbars=yes”);
});
});

but it doesnt work

Hi,

You can try this code instead.

jQuery(function($) {
$(".sfm-menu-item-3246").click(function () {
     window.open('http://shofarmessiah.wixsite.com/shofar-messiah-radio','popUpWindow','height=560,width=1020,left=500,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=middle,directories=no, status=no');
});
});

Hope that helps

1 Like

Ohh yes its great! much thanks!

But just one little problem.
on the menu item i have a “#” link.
when i have # on the link so when i click the menu item it goes to the top of the page.
and when i delete it and leave link field empty it refreshes the page.

any solution of how can the menu item be clicked without effecting the page?

Hi there,

A hard thing to solve and it is indeed way out of our support scope. This is the last try we will do to be of an extra help regarding this matter. I am not sure if this will help but in general whenever we want to avoid the default browser behavior which is going to the top of the page in case the HREF is # we add return false;:

jQuery(function($) {
$(".sfm-menu-item-3246").click(function () {
     return false;
     window.open('http://shofarmessiah.wixsite.com/shofar-messiah-radio','popUpWindow','height=560,width=1020,left=500,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=middle,directories=no, status=no');
});
});

Unfortunately, we will not be able to help you more on this matter. If you still have the problem you will need to hire a developer to do the customization for you.

Thank you for your understanding.

1 Like

Hey!

wow much thanks Christopher,

it actualy worked when i wrote the return false; below the window.open

    jQuery(function($) {
            $(".sfm-menu-item-3291").click(function () {
                window.open("https://bit.ly/2I56qZE", "popupWindow", 'height=560,width=1020,left=500,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=middle,directories=no, status=no');
   return false;
  });
        });

Now i am trying to do the same to the on class click one could you guide me please?

jQuery('.sfm-menu-item-3246').addClass('Tampar');

    jQuery(function($) {
    $( '.sfm-menu-item-3246' ).on( "click",function() {
      $('.Tampar').trigger('click');
  });
});

Hi there,

We can’t provide any further customization but you’re free to enhance. I’ll give a bit of direction, the equivalent of return false; in jQuery is preventDefault(). Hence, it would be like this

.on( "click",function( e ) {
e.preventDefault();

Based on this, please enhance your code as we can’t provide further customization.

Thanks!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.