Home > Dojo
Dojo Archive
[dojo] Smooth Scrolling “Go To Top” Link
- 2010-06-17 (木)
- Dojo
滑らかにスクロールするトップに戻るボタンのDojo版。
DavidのソースにSmoothScrolllつけてみたよ。
DojoのSmoothScrollはDojox内にあるのでfxとfx.scrollをrequireする必要があります。
クリックしたときにstopEventするとアンカーがURLに反映されなくなる。これはMooToolsとかでも同じですな。
JavaScript:
-
(function(d,$) {
-
d.require('dojox.fx');
-
d.require("dojox.fx.scroll");
-
-
d.addOnLoad(function() {
-
-
var topLink = $('gototop');
-
d.style(topLink,{
-
'opacity': 0,
-
'visibility': 'visible',
-
'display':'block'
-
});
-
-
d.connect(topLink,'onclick',function(e){
-
d.stopEvent(e);
-
dojox.fx.smoothScroll({'node':d.body(),'win':window,'duration':300}).play();
-
});
-
-
d.connect(window,'onscroll',function(e) {
-
var scrollY = -d.position(d.body()).y, thresh = 100;
-
/* d['fade' + (scrollY> thresh ? 'In' : 'Out')]({ node: topLink }).play(); */
-
d.anim(topLink, { 'opacity': (scrollY> thresh ? 1 : 0 ) });/* more concise, @phiggins */
-
-
});
-
});
-
})(dojo,dojo.byId);
- Comments: 0
- Trackbacks: 0
ホーム > Dojo
-
- そしてこのSQLはわれながらよく書いたと思う 2010-11-15
- CSVの列っていう方がいいのかな…118項目だった 2010-11-15
- 楽天のCSVの項目が116個もあった衝撃 2010-11-15
- オフィスで香水臭振りまくのは迷惑だと知れ 2010-11-15
- ぐあー フレグランステロやー 2010-11-15
- More updates...
Powered by Twitter Tools
-
- ホームページビルダー
- 擬似クラス
- 楽天
- 1Column
- 2BOX
- 2ch
- 2column
- 2Helvs
- 3column
- 5BOX
- Actionscript
- Ajax
- Animation
- AntiSpam
- API
- apple
- Aptana
- Aqua
- ASCII
- Assets
- AutoExternalLink
- background
- backup
- BETA
- Blog Status
- breadcrumb
- Bubble
- bug
- Button
- calendar
- Calendarizm
- canvas
- Center
- Chain
- Chrome
- Class
- Click Event
- CMS
- ColorMeShopPro
- ContactForm
- Control
- Cookie
- CSS
- CSS3
- CSV
- Custom
- date()
- Demo
- Dojo
- Download
- Dreamweaver
- dropdown
- Dummy Text
- Effect
- Elastic
- Error
- Filter
- filter.html
- FireFox
- Fixed
- Flash
- Floating
- foglio
- Form
- free material
- free script
- Function Reference
- Fx.Morph
- Fx.Scroll
- Fx.Slide
- Fx.Tween
- gettext
- get_posts
- GMarker
- Go-To-Top
- GoogleChart
- GoogleEarth
- GoogleMap
- GoogleSearch
- Hack
- Halves
- Highlight
- Horizontal
- HTML&XHTML
- HTML5
- HTML5API
- Icon
- IE
- illustrator
- infowindow
- iphone
- Javascript
- jQuery
- jQuery.plugin
- KML
- LeftMenu
- liquid
- ListMenu
- Localization
- login-system
- Magpie RSS
- Mobile
- mooFollow
- MooTools
- mooTyping
- number format()
- OnlineGame
- OOP
- OpenPNE
- Pagenation
- permalink
- Photoshop
- PHP
- ping
- plugin
- poedit
- Polyline
- prototype.js
- Regular Expression
- RightMenu
- rollover
- RPC
- RSS
- Safari
- Sample
- script.aculo.us
- scrollbar
- selection
- selectors
- SEO
- session
- Shortcode
- Sidebar Widgets
- slimbbs
- Smarty
- SmoothScroll
- strtotime()
- Symphony-CMS
- Tableless
- Tab Menu
- Tar
- Template
- Template Engine
- Template Tags
- time()
- TinyMCE
- token
- Tooltip
- Transparent
- Tutorial
- Tutoriarl
- Valid
- Validator
- vertical-align
- Web Browser
- Web Site
- Wiki
- window.open
- wordpress
- wp-custom
- wp-function
- wp-plugin
- wp-themes
- xampp
- XHTML
- XML
- YUI
- Zend Framework
- Zend_Form
- Zend_View
- zeromail