Home > Tags > plug-ins
Page 1

How To Change A Page’s Background As The User Scrolls

jQuery is great for adding enhancing effects that would otherwise be impossible with just HTML and CSS. In this tutorial we’re going to use jQuery and two plugins to gradually change a website’s background as the user scrolls the page.

We’ll be using the Color Animation and Waypoints plugins. The Color Animation plugin adds animations to the color properties of elements. jQuery already includes an animate function, this plugin simply extends it. The Waypoints plugin allows us to execute a function when a user scrolls past a certain element. I’m sure it’s obvious how these two plugins will help us achieve our goal.

First things first, let’s set up our project folder. Create index.html and style.css. Leave them in the root directory. Then, add a js folder. This is where we’ll put our JavaScript files.

We can grab the newest version of jQuery here and put it in the js folder. Next, create a script.js file in the js folder.

We’ll use script.js to add the Color Animation and Waypoints plugins. Get Color Animations from here and Waypoints from here. We can paste these two plugins directly into our script.js file.

The Markup

The HTML markup in this tutorial is going to be very simple. We’re just going to have a bunch of paragraphs and headings. The idea is to simulate a fairly long page so we’ll have a lot to scroll through.

Start by adding this code to index.html:

<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> <div class="container"> </div><!-- end container --> </body> </html>

This gives us a nice basic structure to start from, but remember, we need to include our JavaScript files too. Before the closing head tag, add these two lines:

<script src="js/jquery-1.6.2.min.js"></script> <script src="js/script.js"></script>

Inside the div with the class container add the following code:

<h1>A Story About Colors</h1> <h2 id="chapter1">In The Beginning, There Was Yellow</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit accum. Sed a ornare massa. Donec ac sapien a sem aliquet facilisis. Nulla vitae nunc tortor, at luctus risus. Integer viverra sapien a nibh condimentum sed luctus lorem interdum. Aliquam...
more →
Leo Aljiro says: Demo would be nice but I can see you really want us to try it out on our own to see the effect. Either way useful tutorial....

How to Secure WordPress Part 1 – The Basics

WordPress is easily one of the most popular web applications in use, and that makes it quite a target for malicious hackers using PHP injections, SQL injections, Cross-Site Scripting and many others to compromise blogs that are not secure.

You see, WordPress made its bones on how easy it is to install and use. Users quickly get hung up on finding, or designing, the right template for the blog’s UI and activating all the plug-ins needed to enhance the site’s functionality. Unfortunately not many people give securing WordPress a second thought.

WordPress, being a web application, offers attackers many different ways to exploit the software. This guide will help you better defend your WordPress site against these malicious attacks to keep your site up and running.

The Installation

Securing any web application should start with the installation process. As stated earlier, the WordPress installation is ridiculously easy. However most hosting companies make installing WordPress even easier by using installer tools, like Fantastico, to automate the installation. Don’t use these tools, they often configure your software with default settings that attackers look for when choosing a target.

Instead of relying on an installer, download the latest version of WordPress and upload it to the directory on your server where you wish to host your blog. You can follow the easy five minute installation guide, but there are a few things that we are going to address to make WordPress more secure but before we get started, you are going to need to do a few things before and during the installation:

When creating the database (before the installation process) be sure to name the it something that does not identify it as the WordPress database. During the installation process make sure to change the default database table prefix from “wp_” to something less conspicuous. Change the default username from “admin” to something else.

Of course I would be neglect if I didn’t remind you that you need to use strong passwords for everything, including your FTP authentication, usernames, databases, etc.

After the installation

Once the installation process is complete there is still quite a bit of work to be done securing WordPress.

Step 1 – Authentication Keys

The authentication system of WordPress can be improved to add more security to your site by adding unique, or secret, keys. These can be obtained by visiting https://api.wordpress.org/secret-key/1.1/salt/. Here you will find a set of randomly generated keys that look like this:

define('AUTH_KEY',         'N4 <I0 ~l70/=<y>BTvm9m.zX^N+4L@OK~;=,JqXZb58V6exiR_R^QSm|z0-Ts+N'); define('SECURE_AUTH_KEY',  '=j+({-GRWxYbAU[-|tfU@_2[p>:Yl(VV3uq}ZdM) h)cG+/anf}c,}{@oVD8 kzl'); define('LOGGED_IN_KEY',    'wK:WK:)[0.d`5k;r&[~8.3DcuOee?:W9!b$]odZ^v/(IiMdb0O?<IB?mdHf3`VCC'); define('NONCE_KEY',        'mG-VUfq/A4:?3}a|B<*NdGyk^wE*_`zRJX[VVfvm&y/B;%9O[bX/A5j3rkW*d.jA'); define('AUTH_SALT',        '2>N6igpu*Idk+%=&6]Z4Vc)-;/BOdiec0=N?sgcWK4$|T8kJP1>]/Nn%r*QP9|n^'); define('SECURE_AUTH_SALT', 'F#9^SVxj6ZO_*J0%CGUFK}P !q-v<N(Is|h@<N,ze6sQ+%n@fk[-y-zBJQS!:hIs'); define('LOGGED_IN_SALT',   'evjn3aEM0UA8UF|du|I]WSG.i_B|@)^=.-5-qY)p}m9[kwVD|gjVOj[l_(?S9W%<');...
more →
Andrew Nacin says: Good article. That said, the "security by obscurity" techniques used in steps 3 and 4 are not security-oriented and really don't...