Archive for January, 2011

[Updated] XML banner fader in jQuery – with cross-fading

1

This is an update to my XML Banners code, this one includes cross-fading, it’s slightly more complex as you need two images in your HTML to cross-fade, and use them positioned at (0,0) in your original banners DIV.

Demo of XML cross-fading banners in jQuery

Download ZIP of all files (123Kb)

XML banner fader in jQuery

7

More jQuery animation! This one puts a fading set of banners on your page. It uses simple XML to tell the javascript what banners to pull in, and the URLs you want the banners to link to. This is ideal for linking to top featured stories.

Demo of XML banners in jQuery

Download ZIP of all files (123Kb)

Here’s the XML code.


< ?xml version="1.0" encoding="utf-8"?>







(more…)

Quick Tip: MySQL database dump

0

In response to @ChrisWhoCodes here’s some useful snippets for MySQL database backups.

Dump your entire database to a file, schema and data:

mysqldump -u db_user -p databasename > output.sql

Dump your database schema only

mysqldump -u db_user -p --no-data databasename > output.sql

Don’t think it gets much simpler than that. You must include -u and -p if you don’t have localhost privileges set up, and db_user must be the user with privileges for that database, or a root/superuser. If you want to export all databases, just user –all-databases as an export option, if you do, you need to make your db_user root or a superuser.

There’s a load more options at the MySQL manual page for mysqldump.

If you want to pull your data into a new instance of mysql, say for moving servers, it’s just this:

mysql -u db_user -p < output.sql

Note: It will drop any tables currently in that database.

Quick Tip: Get bit.ly stats for any bit.ly link.

0

You can look at any bit.ly link stats for anyone, just adding + to the end of the URL. e.g. http://bit.ly/gFIyz5 becomes http://bit.ly/gFIyz5+

Useful to find out where other people get their incoming links from. Even competitors.

News feed scroller in jQuery

3

Sometimes you need a little news feed on your homepage with some animation to attract the eye, it’s not as bad as a marquee tag, and jQuery lets you do animation very easily.

Demo of News Scroller

Download ZIP of all files (3Kb)

Here’s the CSS code you’ll need.

CSS

@charset "utf-8";
/* CSS Document */

#newsscroll{
	color: white;
	font-size: 12px;
	width: auto;
	padding: 5px;
	position:relative;
	overflow: hidden;
	background-color: #000;
}

#newsscroll_link{
	color: white;
	text-decoration: none;
	position: relative;
}

#newsscroll_link:hover{
	color: blue;
}

(more…)

Go to Top