04-23-2009, 09:30 AM
|
#16 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
Quote:
Originally Posted by Kalle
sketchMedia, I sometimes miss that loose syntax from javascript in PHP, especially when I've been coding Javascript for a few days without PHP. But atleast PHP 5.3 now got Closures!
allworknoplay, I would suggest using Mootools, a nice and easy small framework:
http://www.mootools.net/
|
Yea I too love the loose syntax it can be powerful but also it can be awkward if your not careful.
Looking forward to 5.3, closures, namespaces and late static binding are gonna be very useful indeed!
For the lightboxes, there are 1000's of plugins for more or less all frameworks
http://www.phatfusion.net/multibox/ - is one for mootools
http://leandrovieira.com/projects/jquery/lightbox/ - jquery
For the loader, in jQuery we could do something like this:
javascript Code:
$(function(){ $("#loader").bind("ajaxSend", function(){ $(this).show(); }).bind("ajaxComplete", function(){ $(this).hide(); }); $("#load").click(function(){ $("#response").load('somethingHereToLoad.html'); }); });
you need html like this:
html Code:
<div id="loader" style="display: none">Loading content ... </div> <div id="response"></div> <a href="#" id="load">Load!</a>
There are lots of ways of doing this in either framework.
Quote:
|
I would recommend writting one in regular javascript (only about 20 lines) so that you really understand what is going on. Then when you implement it in mootools/jquery you will see how great and simple they have made it.
|
Agree, there is no point in learning a framework and not having a firm understanding of the language. An exercise like that will really hammer it home and also highlight why I use a framework more often than not!
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|