May1
Just a quick one, if you want to manipulate the last instance of an element (or any element) on a page, you can do this SO easily and quickly with jQuery.
$(function() {
$("dt:last").addClass("last");
});
This (obviously!) adds the class ‘last’ to the final dt element in the document. The cool thing is you could use $(“dt:last-1″) to access the second dt element, so flexible and easy to use…
//
April10
The main jQuery pagination plugin page, bit disappointing to be honest, a lot of vertical scrolling solutions which I think are pointless. But there is one little gem, which isn’t really what you would use for paginating large tables of mysql data for example, but which is ideal for paginating almost any kind of page element! That’s right, you can very, very easily paginate li’s, table rows, whatever you like with Quick Paginate. Definitely worth a look…
And one of the coolest effects I’ve seen, is the glow plugin. You’ve got to see the example. However, the full effects of the glow need to be seen in Safari (for the time being), in other browsers you just get a cool fading color effect – but the future looks bright (ahem)!
//
April4
Quickest and easiest tutorial, and should be your first starting point as it serves as a good, simple introduction to the XMLHttpRequest object. Then one of the first AJAX tutorials is here. Typical creation of the object:
function ajaxFunction()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
}
//
April3
Thanks to this excellent blog, this is how to get a page to auto refresh on a timer using javascript (in this example its on a 10 second timer):
<script type=”text/javascript” language=”javascript”>
var reloadTimer = null;
window.onload = function()
{
setReloadTime(10); // In this example we’ll use 10 seconds.
}
function setReloadTime(secs)
{
if (arguments.length == 1) {
if (reloadTimer) clearTimeout(reloadTimer);
reloadTimer = setTimeout(“setReloadTime()”, Math.ceil(parseFloat(secs) * 1000));
}
else {
location.reload();
}
}
</script>
And you can do the following to add a link to refresh the page:
<a href=”javascript:location.reload();”>Refresh the page</a>
reload() refreshes from the cache, so if you want to force it to get a fresh copy via GET from the server, pass ‘true’ as a param. E.g. <a onclick=”location.reload(true)” href=”#”>Refresh the page</a>
You can also do :<meta http-equiv=“Refresh” content=“n;url”/>, just leave off the url if you want to refresh to the current page.
//
February14
For a starting point on jQuery, here’s a page with a load of useful links (at the bottom) from good old Smashing Magazine.
Here’s a great tutorial resource for jQuery – tonne of good links off it too. One of the best, which starts with the most fundamental/basic topics, and works its way up to writing a jQuery plugin, is unsurprisingly one of jQuery’s own tutorials, by Jörn Zaefferer. A good, basic end() example.
Here’s a handy cheatsheet too, and a great page on manipulation capabilities.
Pretty much all you need on SiFR is right here. And here’s how to create your own Flash files without using Adobe suite. No you’ve got no excuse!
//