The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Widget to template

View previous topic View next topic Go down

Solved Widget to template

Post by Luffy on November 24th 2013, 4:00 pm

Hi, i am using these arrows on the forum but they are in a widget.


Is there any way to put them in the template?


Widget Code:
Code:
<div style="position:fixed; right:0.1%; bottom:45%;">
            <div id="nav_up"><img src="http://i57.servimg.com/u/f57/11/38/18/62/iiii10.gif" alt="Πάνω" title="Πάνω" border="0"></div>
            <div id="nav_down"><img src="http://i57.servimg.com/u/f57/11/38/18/62/isiii11.png" alt="Κάτω " title="Κάτω" border="0"></div>
            </div>


                  <script type="text/javascript">
                    jQuery(function() {
                        var overelem = jQuery('body');
                 
                        jQuery('#nav_up').fadeIn('slow');
                        jQuery('#nav_down').fadeIn('slow');
                                     
                        jQuery('#nav_down').click(
                          function (e) {
                              jQuery('html, body').animate({scrollTop: overelem.height()}, 1100);
                          }
                        );
                        jQuery('#nav_up').click(
                          function (e) {
                              jQuery('html, body').animate({scrollTop: '0px'}, 1100);
                          }
                        );
                        });
                    </script>

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Widget to template

Post by Ange Tuteur on November 24th 2013, 4:13 pm

If you want it to work on almost all pages you would have to add it to nearly every single template. I think you would be best sticking with the widget. thumright

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Widget to template

Post by Luffy on November 24th 2013, 4:23 pm

i only want it in the forum.. not in all pages. only in homepage.. can i put it as it is in the template? or it needs any changes..






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Widget to template

Post by Ange Tuteur on November 24th 2013, 4:28 pm

Okey dokey,

Administration Panel > Modules > HTML & JAVASCRIPT > Javascript codes management > Create a new script

Name: what you wish
Placement: In the homepage
Code:
jQuery(function() {
jQuery('body').append('<div style="position:fixed; right:0.1%; bottom:45%;"><div id="nav_up"><img src="http://i57.servimg.com/u/f57/11/38/18/62/iiii10.gif" alt="Πάνω" title="Πάνω" border="0"></div><div id="nav_down"><img src="http://i57.servimg.com/u/f57/11/38/18/62/isiii11.png" alt="Κάτω " title="Κάτω" border="0"></div></div>');
});

                    jQuery(function() {
                        var overelem = jQuery('body');
                
                       jQuery('#nav_up').fadeIn('slow');
                        jQuery('#nav_down').fadeIn('slow');
                                    
                       jQuery('#nav_down').click(
                          function (e) {
                              jQuery('html, body').animate({scrollTop: overelem.height()}, 1100);
                          }
                        );
                        jQuery('#nav_up').click(
                          function (e) {
                              jQuery('html, body').animate({scrollTop: '0px'}, 1100);
                          }
                        );
                        });
Save and it should only run in the homepage.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Widget to template

Post by Luffy on November 24th 2013, 4:36 pm

I don't know but this works fine to all pages also!!

You are great!! Solved..






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Widget to template

Post by Ange Tuteur on November 24th 2013, 4:39 pm

Topic Solved and Archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum