{{extend 'layout.html'}}
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/3.4.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/3.4.1/themes/base/jquery-ui.css" type="text/css">
<style>
/*QuickReset*/
*{margin:0;box-sizing:border-box;} html,body{height:100%;font:14px/1.4 sans-serif;}
article {
height: 150vh;
}
</style>
</head>
<!--button onclick="goTo(selector, timeout, cb)">Click me</button-->
<body>
<article style="background:#0bf;" id="top">WELCOME (waits 3 sec)</article>
<article style="background:#f0b;" id="about">{{=me}}</article>
<article style="background:#b0f;" id="work">{{=work}}</article>
<article style="background:#0fb;" id="testimonials">{{=love}}</article>
<article style="background:#fb0;" id="contact">
CONTACT <a href="#top">TO TOP</a>
</article>
<script type="text/javascript" src="https://code.jquery-3.4.1.min.js">
function goTo(selector, timeout, cb) {
var $el = $(selector);
if (!$el[0]) return;
var $par = $el.parent();
if ($par.is("body")) $par = $("html, body");
setTimeout(() => {
$par.stop().animate({scrollTop: $el.offset().top}, 1000, cb && cb.call($el[0]));
}, timeout || 0);
}
// USE LIKE:
goTo("#testimonials", 3000, function() {
// You can use `this` to reference #testimonials! yey
$(this).append("<br>Going to #contact in 3sec!");
goTo("#contact", 3000);
});
// Alternatively, without using callbacks you can do
//goTo("#testimonials", 3000);
//goTo("#contact", 6000);
// Reuse function for elements click!
$("[href^='#']").on("click", function(e) {
e.preventDefault();
goTo($(this).attr("href"));
});
</script>
</body>
</html>
{{extend 'layout.html'}}
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{=URL('static','js/jquery-1.10.1.js')}}"></script>
<style id="compiled-css" type="text/css">
/*QuickReset*/
*{margin:0;box-sizing:border-box;} html,body{height:100%;font:14px/1.4 sans-serif;}
article {
height: 150vh;
}
<
/style>
<body style="">
<article style="background:#0bf;" id="top">WELCOME (wait 3 sec)</article>
<article style="background:#f0b;" id="about">ABOUT</article>
<article style="background:#b0f;" id="work">OUR WORK</article>
<article style="background:#0fb;" id="testimonials">TESTIMONIALS<br>Going to #contact in 3sec!</article>
<article style="background:#fb0;" id="contact">
CONTACT <a href="#top">TO TOP</a>
</article>
<script type="text/javascript" src="{{=URL('static','js/jquery-1.10.1.js')}}">
function goTo(selector, timeout, cb) {
var $el = $(selector);
if (!$el[0]) return;
var $par = $el.parent();
if ($par.is("body")) $par = $("html, body");
setTimeout(() => {
$par.stop().animate({scrollTop: $el.offset().top}, 500, cb && cb.call($el[0]));
}, timeout || 0);
}
// USE LIKE:
goTo("#testimonials", 3000, function() {
// You can use `this` to reference #testimonials! yey
$(this).append("<br>Going to #contact in 3sec!");
goTo("#contact", 3500);
});
// Alternatively, without using callbacks you can do
// goTo("#testimonials", 3000);
// goTo("#contact", 6000);
// Reuse function for elements click!
$("[href^='#']").on("click", function(e) {
e.preventDefault();
goTo($(this).attr("href"));
});
</script>
</body></html>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/AE0mb8FtMM4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/7972be54-f400-42f0-83a7-46b7b8fee63f%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CALkNK55hRxAk%3DkTua3Pi-JC_Ac0ZSS%2BDp6SpSFGsAD4MzAjk9Q%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/7972be54-f400-42f0-83a7-46b7b8fee63f%40googlegroups.com.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/AE0mb8FtMM4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/91e9fdda-76d6-4dcd-8d63-07cf110fccb4%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAAcHJF8LLK2TNR%2Bf3G52Ru36Y8PeNCtVni-DNTZe7xe4m38fvw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/91e9fdda-76d6-4dcd-8d63-07cf110fccb4%40googlegroups.com.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/AE0mb8FtMM4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAAcHJF8LLK2TNR%2Bf3G52Ru36Y8PeNCtVni-DNTZe7xe4m38fvw%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAAcHJF8LLK2TNR%2Bf3G52Ru36Y8PeNCtVni-DNTZe7xe4m38fvw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAERBpoBQbRap6AE3_QXjqfKtB7UwwMaFMCb6UR2zUx2AjWYJug%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/30a99012-045e-46a8-a650-4252439c2e83%40googlegroups.com.