Community Page
- www.prodevtips.com Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- any update on Call to undefined method User::updateMe() error???
- منتدى راما منتديات راما صور خواطر نقاشات ضحك فرفشه اخبار الفن ستار اكاديمي سياحه ديكور ازياء صحه طبخات رياضه بلوتوث ثيمات وسائط افلام اكشن تصاميم اغاني ميوزك raamaa منتديات راما خدمات منوعة و فوائد...
- sankes www.saso2.com
- thank you for this tutorial www.struc-eng.com
- this is wonderful tutorial .. i read it 3 times and get a fantastic results and sure i put a copy of this lesson on my site here www.ebneleslam.com
ProDevTips
Mainly tutorials and tips relating to web development with PHP, Javascript, jQuery and Ruby
I recently discovered jQuery and I thought it looked great. I could hardly wait to try it out in a project and the time has finally come.
In this case we have a list of feeds with the following requirements:
1.) When a link next to the title of each item is pressed we want to display [...% ... Continue reading »
In this case we have a list of feeds with the following requirements:
1.) When a link next to the title of each item is pressed we want to display [...% ... Continue reading »
1 year ago
function toggleViz(el_id){
$("#"+el_id).toggleClass("hidden_simple");
if($("#"+el_id).attr("className") != "hidden_simple"){
// see the modification here V
$.scrollTo( "#"+el_id, {speed:500});
}
}
1 year ago
<a href="javascript:toggleViz('{$feed.id}')" rel="nofollow">morestuff could probably be implemented with some kind of callback event functionality. It's on my to do list.1 year ago
1 year ago
If you are interested, that function could be shorter written like this:
function toggleViz(el_id){
var $el = $("#"+el_id).toggleClass("hidden_simple");
if ( !$el.is('.hidden_simple') )
$.scrollTo( $el, {speed:500});
};
I do admit the examples don't show all the possible uses of the plugin. But the source code has some more examples and explains each customizable option too.
Please let me know, if you think it's not clear enough, thanks.
1 year ago
1 year ago
!$el.is(’.hidden_simple')
to
!$el.hasClass(’.hidden_simple')
I ran a few very basic speed tests and found the hasClass() method to be about 30% faster.
1 year ago
Thanks,
Rich
1 year ago
Rich: I will link to that whole project when it is finished. In the meantime what we do here is simply making the main browser window scroll to make the element clicked centered vertically. The purpose is to enhance the usability of the interface.
1 year ago
If you use hasClass, you must remove the dot leading the className. As for speed.. that is odd, because if you take a look at hasClass:
hasClass: function(expr) {
return this.is("." + expr);
},
It's doing, internally, the same as I did. I don't think it can be really faster. hasClass is useful when you have the className in a variable, so it saves you the '#' + klass .
1 year ago
1 year ago
example at www.dzone.com and just try to scroll down on the page. pretty neat!