WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<?php //ignore this line/******************************************** * Scroll to Top jQuery Plugin from http://www.ph-creative.com/ * @autor Martin Freudenreich (mr-fan) 30-12-09 * * @param where=head or body to setup where you wanna load the js files //default </head> * * Load the jquery.scroll.pack.js from a spezific folder (Template or Media) * Load the needed settings for a first use (JS and CSS) * */$scroll_js = "<!--Scroll to Top Plugin-->\n";$scroll_css = "<!--Scroll to Top CSS-->\n"; //set to </head> or </body> to load the jQueryscripts where you want$places = array ("head", "body");if (!isset($where)) $where= $places[0];else $where = in_array($where, $places) ? $where : $places[0];$where = "</".$where.">";//Scroll to Top JS$scroll_js .= "<script src='".WB_URL."/media/plugins/scrolltotop/jquery.easing.js' type='text/javascript'></script>\n";$scroll_js .= "<script src='".WB_URL."/media/plugins/scrolltotop/jquery.scroll.pack.js' type='text/javascript'></script>\n";$scroll_js .= "<script type='text/javascript'>\n";$scroll_js .= "$(function() {\n";$scroll_js .= "$('#toTop').scrollToTop({speed:1000,ease:'easeOutCirc',start:700});\n";$scroll_js .= "});\n";$scroll_js .= "</script>\n";//Scroll to Top CSS$scroll_css .= "<style type='text/css'>\n";$scroll_css .= "#top {display:none;}\n";$scroll_css .= "#toTop { width:85px;\n";$scroll_css .= "background:#f1f1f1;\n";$scroll_css .= "border:1px solid #ccc;\n";$scroll_css .= "text-align:center;\n";$scroll_css .= "padding:3px;\n";$scroll_css .= "position:fixed;\n";$scroll_css .= "bottom:10px;\n";$scroll_css .= "right:10px;\n";$scroll_css .= "cursor:pointer;\n";$scroll_css .= "color:#666;\n";$scroll_css .= "text-decoration:none; }\n";$scroll_css .= "</style>\n";//Scroll to Top Anchor$wb_page_data = str_replace("<body>","<body>\n<div id='totop'><a name='totop'></a></div>", $wb_page_data );//Scroll to Top Link$scroll_link = "<a href='#totop' id='toTop'>^ Nach oben!</a>\n";//insert the CSS to your page output - always to the head section!$wb_page_data = str_replace("</head>",$scroll_css."</head>", $wb_page_data );//insert the JS to your page output$wb_page_data = str_replace($where,$scroll_js.$where, $wb_page_data );//insert the Link on the Place where the Droplet is calledreturn $scroll_link;//outputreturn true;
Be carefull with setting <style > between body tags. It's not allowed and will be deleted by the new recoded droplet engine. Set it to extern css and included it with jquery insert.js. This plugin set the css within the headDietmar
//insert the CSS to your page output - always to the head section!$wb_page_data = str_replace("</head>",$scroll_css."</head>", $wb_page_data );
//Scroll to Top CSS$scroll_css .= "<style type='text/css'>\n";$scroll_css .= "#top {display:none;}\n";$scroll_css .= "#toTop { width:85px;\n";$scroll_css .= "background:#f1f1f1;\n";$scroll_css .= "border:1px solid #ccc;\n";$scroll_css .= "text-align:center;\n";$scroll_css .= "padding:3px;\n";$scroll_css .= "position:fixed;\n";$scroll_css .= "bottom:10px;\n";$scroll_css .= "right:10px;\n";$scroll_css .= "cursor:pointer;\n";$scroll_css .= "color:#666;\n";$scroll_css .= "text-decoration:none; }\n";$scroll_css .= "</style>\n";
<?php //color your live//Scroll to Top Anker setze ich per wb_page_data exakt nach </body> also an den anfang der seite!!$wb_page_data = str_replace("<body>","<body>\n<div id='top'><a name='top'></a></div>", $wb_page_data );//Scroll to Top Link kommt fix per CSS positioniert!$scroll_link = "<a href='#top' id='toTop'>^ Nach Oben</a>\n";//CSS wird immer im Head geladen egal wo ich das JS lade!!!$wb_page_data = str_replace("</head>",$scroll_css."</head>", $wb_page_data );//JS kommt dort hin wo ich will per einfachem ?parameter....im droplet wie schon einige mal _UND_ im tutorial ausführlich beschrieben....$wb_page_data = str_replace($where,$scroll_js.$where, $wb_page_data );//insert the Link ---ist ja klar der muss auch ausgegeben werdenreturn $scroll_link;//startet das ganze spektakel....fertig return true;
Hi,Code: [Select]//Scroll to Top CSS$scroll_css .= "<style type='text/css'>\n";$scroll_css .= "#top {display:none;}\n";.....And what is this?Dietmar
//Scroll to Top CSS$scroll_css .= "<style type='text/css'>\n";$scroll_css .= "#top {display:none;}\n";.....
@oeh: mulitlang sites.....hmm there are several ways for such sites to build.....maybe it depends on the footer usage-> try to use the droplet direktly in your template->check the paths of the scripts (firebug) if it doesn't works again - please set E reporting on...to see whats wrongregards martin
Quote from: mr-fan on March 04, 2010, 12:01:13 PM@oeh: mulitlang sites.....hmm there are several ways for such sites to build.....maybe it depends on the footer usage-> try to use the droplet direktly in your template->check the paths of the scripts (firebug) if it doesn't works again - please set E reporting on...to see whats wrongregards martinI'll try to put it in the index file.I've used the WB docu way, when creating the multi lang site.Also I'll try out firebug.
@oeh: have you loaded jQuery!!?? this is required for a jQuery plugin....?regards martin
oh somebody use such kind of droplets....
ok can you send me a link to your page?
what WB version you use with this droplets...and what kind of jQuery 1.3.2 or 1.4.1 (iv'e tested this two versions)
how you call jQuery files....with droplet or with the official way with register_modfiles.. .?