<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Script Tutorials &#187; jQuery | Script Tutorials | Web development</title> <atom:link href="http://www.script-tutorials.com/tag/jquery/feed/" rel="self" type="application/rss+xml" /><link>http://www.script-tutorials.com</link> <description>Tutorials for Web Developers</description> <lastBuildDate>Fri, 03 Feb 2012 06:07:51 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>10 fresh jQuery plugins (january 2012)</title><link>http://www.script-tutorials.com/10-fresh-jquery-plugins-january-2012/</link> <comments>http://www.script-tutorials.com/10-fresh-jquery-plugins-january-2012/#comments</comments> <pubDate>Tue, 31 Jan 2012 16:49:15 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[resources]]></category> <category><![CDATA[january]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[roundup]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1400</guid> <description><![CDATA[10 fresh jQuery plugins (january 2012) Our new hand-made collection of most impressive jQuery plugins. Here are different plugins for zooming, calendars, news ticker, and even full UI packs, nice file uploader and more. 1. jQuery UI Bootstrap A jQuery UI theme based on Twitter Bootstrap. 2. jqGrid This is pretty useful jQuery grid plugin. [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-fresh-jquery-plugins-for-working-with-forms-and-ui/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/101/thumb.png" alt="10 fresh jQuery plugins for working with forms and UI" /> 10 fresh jQuery plugins for working with forms and UI</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-jquery-plugins-december-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/210/thumb.png" alt="10 fresh jQuery plugins (december 2011)" /> 10 fresh jQuery plugins (december 2011)</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-jquery-plugins-may-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/73/thumb.png" alt="10 Oven Fresh jQuery Plugins" /> 10 Oven Fresh jQuery Plugins</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Ten fresh jQuery plugins (january 2012)" src="http://www.script-tutorials.com/demos/227/thumb.png"></div><p><strong>10 fresh jQuery plugins (january 2012)</strong><br
/> <br
/>Our new hand-made collection of most impressive jQuery plugins. Here are different plugins for zooming, calendars, news ticker, and even full UI packs, nice file uploader and more.<br
/> <span
id="more-1400"></span></p><hr
/><h3><a
rel="nofollow" target="_blank" href="http://addyosmani.github.com/jquery-ui-bootstrap/">1. jQuery UI Bootstrap</a></h3><p>A jQuery UI theme based on Twitter Bootstrap.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img1.png" alt="jQuery UI Bootstrap" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.trirand.com/blog/">2. jqGrid</a></h3><p>This is pretty useful jQuery grid plugin. Online demo you can find <a
rel="nofollow" target="_blank" href="http://www.trirand.net/demophp.aspx">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img2.png" alt="jqGrid" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.professorcloud.com/mainsite/cloud-zoom.htm">3. Cloud Zoom</a></h3><p>Cloud Zoom is a small jQuery image zoom plugin with smooth zoom movement, gallery mode, tint, soft focus and other zoom features.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img3.png" alt="Cloud Zoom" /></p><h3><a
rel="nofollow" target="_blank" href="http://reaktor.github.com/jquery-continuous-calendar/">4. jQuery continuous calendar</a></h3><p>Another one calendar plugin with next features: date dragging, continuous month flow, range shifting by dragging, range expand with shift + mouse click etc.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img4.png" alt="jQuery continuous calendar" /></p><h3><a
rel="nofollow" target="_blank" href="http://code.google.com/p/flot/">5. Flot</a></h3><p>Flot is a pure Javascript plotting library for jQuery. It produces graphical plots of arbitrary datasets on-the-fly client-side. Online demo you can find <a
rel="nofollow" target="_blank" href="http://people.iola.dk/olau/flot/examples/interacting.html">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img5.png" alt="Flot" /></p><h3><a
rel="nofollow" target="_blank" href="http://arshaw.com/fullcalendar/">6. FullCalendar</a></h3><p>FullCalendar is a jQuery plugin that provides a full-sized, drag &#038; drop calendar like the one below. It uses AJAX to fetch events on-the-fly for each month and is easily configured to use your own feed format (an extension is provided for Google Calendar).<br
/> <img
src="http://www.script-tutorials.com/demos/227/img6.png" alt="FullCalendar" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.jquerynewsticker.com/">7. jQuery News Ticker</a></h3><p>Taking inspiration from the BBC News website ticker, jQuery News Ticker brings a lightweight and easy to use news ticker to jQuery.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img7.png" alt="jQuery News Ticker" /></p><h3><a
rel="nofollow" target="_blank" href="http://blueimp.github.com/jQuery-File-Upload/">8. jQuery File Upload</a></h3><p>File Upload widget with multiple file selection, drag&#038;drop support, progress bar and preview images for jQuery. Supports cross-domain, chunked and resumable file uploads.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img8.png" alt="jQuery File Upload" /></p><h3><a
rel="nofollow" target="_blank" href="http://javascriptmvc.com/">9. JavaScriptMVC</a></h3><p>JavaScriptMVC is an open-source framework containing the best ideas in jQuery development. Online demo you can find <a
rel="nofollow" target="_blank" href="http://javascriptmvc.com/docs.html#!examples">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img9.png" alt="JavaScriptMVC" /></p><h3><a
rel="nofollow" target="_blank" href="http://johnpolacek.github.com/scrollorama/">10. Scrollorama</a></h3><p>The jQuery plugin for doing cool scrolly stuff.<br
/> <img
src="http://www.script-tutorials.com/demos/227/img10.png" alt="Scrollorama" /></p><hr
/><h3>Conclusion</h3><p>Hope that our new collection of new jQuery plugins has been interested for you. Good luck!</p><div
class="shr-publisher-1400"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-fresh-jquery-plugins-for-working-with-forms-and-ui/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/101/thumb.png" alt="10 fresh jQuery plugins for working with forms and UI" /> <br
/> 10 fresh jQuery plugins for working with forms and UI</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-jquery-plugins-december-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/210/thumb.png" alt="10 fresh jQuery plugins (december 2011)" /> <br
/> 10 fresh jQuery plugins (december 2011)</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-jquery-plugins-may-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/73/thumb.png" alt="10 Oven Fresh jQuery Plugins" /> <br
/> 10 Oven Fresh jQuery Plugins</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/10-fresh-jquery-plugins-january-2012/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Powerful Chat System &#8211; Lesson 3</title><link>http://www.script-tutorials.com/powerful-chat-system-lesson-3/</link> <comments>http://www.script-tutorials.com/powerful-chat-system-lesson-3/#comments</comments> <pubDate>Mon, 30 Jan 2012 17:01:39 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[AJAX]]></category> <category><![CDATA[HTML/CSS]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[ajax chat]]></category> <category><![CDATA[chat]]></category> <category><![CDATA[chat system]]></category> <category><![CDATA[registration]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1396</guid> <description><![CDATA[Powerful Chat System &#8211; Lesson 3 Today we continue a series of articles on the creation of powerful chat system. Our third lesson will contain next elements: join form (with html5 validation). A long ago, I have already made similar validation. So you can refresh your memories if you like. Today I will publish updated [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-2/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/221/thumb.png" alt="Powerful Chat System &#8211; Lesson 2" /> Powerful Chat System &#8211; Lesson 2</a></li><li> <a
href="http://www.script-tutorials.com/powerful-chat-system/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/218/thumb.png" alt="Powerful Chat System" /> Powerful Chat System</a></li><li> <a
href="http://www.script-tutorials.com/how-to-easily-make-ajax-style-php-chat-application/" rel="bookmark"> <img
src="/ssimages/no_image.gif" alt="How to Easily Make AJAX Style PHP Chat Application" /> How to Easily Make AJAX Style PHP Chat Application</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Powerful Chat System" alt="Powerful Chat System" src="http://www.script-tutorials.com/demos/226/thumb.png"></div><p><strong>Powerful Chat System &#8211; Lesson 3</strong><br
/> <br
/>Today we continue a series of articles on the creation of powerful chat system. Our third lesson will contain next elements: join form (with html5 validation). A long ago, I have already made similar <a
target="_blank" href="http://www.script-tutorials.com/data-validation-html5/">validation</a>. So you can refresh your memories if you like.<br
/> <span
id="more-1396"></span></p><p>Today I will publish updated sources of our growing project (several files was modified, plus I expanded structure of database slightly). All project is well structured: system classes is in &#8216;classes&#8217; folder, stylesheets in &#8216;css&#8217; folder, template files in &#8216;templates&#8217; folder, and &#8211; new folder &#8216;js&#8217; for javascript files.</p><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - demo 226" href="http://www.script-tutorials.com/demos/226/index.php" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - package" href="http://www.script-tutorials.com/demos/226/source.zip" target="_blank">download in package</a></strong></h5><hr
/><p>Now &#8211; download the source files and lets start coding !</p><hr
/><h3>Step 1. SQL</h3><p>I have added new field into table of profiles where we will store its first names. So, please execute next SQL:</p><pre class="brush:sql">
ALTER TABLE `cs_profiles` ADD `first_name` varchar(255) NOT NULL default '' AFTER `name`;
</pre><h3>Step 2. HTML</h3><p>I have updated template with login form. As you can see &#8211; I have expanded this markup and added join form here:</p><h4>templates/logout_form.html</h4><pre class="brush:html">
&lt;div class=&quot;column&quot;&gt;
    &lt;h3&gt;Powerful Chat System Demonstration&lt;/h3&gt;
    &lt;p&gt;Our chat will contain next features: registration, main chat, profiles with avatars, ranking system, private messaging, custom rooms, moderation / administration and possible something else (in future).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;column&quot;&gt;

    &lt;div class=&quot;tabs_container&quot;&gt;
        &lt;ul class=&quot;tabs&quot;&gt;
            &lt;li class=&quot;active&quot;&gt;&lt;h3&gt;Log In&lt;/h3&gt;&lt;/li&gt;
            &lt;li&gt;&lt;h3&gt;Join&lt;/h3&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;

    &lt;div class=&quot;nav_container&quot;&gt;
        &lt;form class=&quot;login_form&quot; action=&quot;index.php&quot; method=&quot;post&quot; id=&quot;1&quot;&gt;
            &lt;label&gt;Username:&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;username&quot;&gt;
            &lt;label&gt;Password:&lt;/label&gt;&lt;input type=&quot;password&quot; name=&quot;password&quot;&gt;
            &lt;input type=&quot;submit&quot; name=&quot;Login&quot; value=&quot;Login&quot;&gt;
        &lt;/form&gt;
        &lt;form class=&quot;join_form&quot; action=&quot;index.php&quot; method=&quot;post&quot; id=&quot;2&quot; style=&quot;display: none;&quot;&gt;

            &lt;label&gt;Full name:&lt;/label&gt;
            &lt;input type=&quot;text&quot; id=&quot;username&quot; name=&quot;username&quot; placeholder=&quot;Your name&quot; maxlength=&quot;128&quot; title=&quot;Your name&quot; required&gt;

            &lt;label&gt;First name:&lt;/label&gt;
            &lt;input type=&quot;text&quot; id=&quot;firstname&quot; name=&quot;firstname&quot; placeholder=&quot;Your first name&quot; maxlength=&quot;128&quot; title=&quot;Your first name&quot;&gt;

            &lt;label&gt;Last name:&lt;/label&gt;
            &lt;input type=&quot;text&quot; id=&quot;lastname&quot; name=&quot;lastname&quot; placeholder=&quot;Your last name&quot; maxlength=&quot;128&quot; title=&quot;Your last name&quot;&gt;

            &lt;label&gt;Email:&lt;/label&gt;
            &lt;input type=&quot;text&quot; id=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Your email&quot; maxlength=&quot;128&quot; title=&quot;Format: *@gmail.com&quot; pattern=&quot;.*@gmail\.com&quot; required&gt;

            &lt;label&gt;Password:&lt;/label&gt;
            &lt;input type=&quot;text&quot; id=&quot;password&quot; name=&quot;password&quot; maxlength=&quot;128&quot; title=&quot;Password&quot; required&gt;

            &lt;label&gt;Repeat Password:&lt;/label&gt;
            &lt;input type=&quot;text&quot; id=&quot;password&quot; name=&quot;password&quot; maxlength=&quot;128&quot; title=&quot;Repeat password&quot; required oninput=&quot;checkpass(this)&quot;&gt;

            &lt;input type=&quot;submit&quot; name=&quot;Join&quot; value=&quot;Join&quot;&gt;
        &lt;/form&gt;
    &lt;/div&gt;

&lt;/div&gt;

&lt;script&gt;
$(document).ready(function(){
    $('.tabs li h3').click(function () {
      $('.tabs li').removeClass('active');
      $(this).parent().addClass('active');

      $('.nav_container form').hide();
      var index = $('.tabs li h3').index(this);
      $('.nav_container form').eq(index).show();
      return false;
    });
});

function checkpass(input) {
    if (input.value != document.getElementById('password').value) {
        input.setCustomValidity('Password must match.');
    } else {
        input.setCustomValidity('');
    }
}
&lt;/script&gt;
</pre><p>Please pay attention to HTML structure of join form, it contain several new attributes for html5 validation: placeholder, required and pattern. This is pretty interesting.</p><h3>Step 3. CSS</h3><p>This file has updated too</p><h4>css/main.css</h4><pre class="brush:html">
/* page layout */
*{
    margin:0;
    padding:0;
}
body {
    background-color:#eee;
    color:#fff;
    font:14px/1.3 Arial,sans-serif;
}
header {
    background-color:#212121;
    box-shadow: 0 -1px 2px #111111;
    display:block;
    height:70px;
    position:relative;
    width:100%;
    z-index:100;
}
header h2{
    font-size:22px;
    font-weight:normal;
    left:50%;
    margin-left:-400px;
    padding:22px 0;
    position:absolute;
    width:540px;
}
header a.stuts,a.stuts:visited{
    border:none;
    text-decoration:none;
    color:#fcfcfc;
    font-size:14px;
    left:50%;
    line-height:31px;
    margin:23px 0 0 110px;
    position:absolute;
    top:0;
}
header .stuts span {
    font-size:22px;
    font-weight:bold;
    margin-left:5px;
}

/* main styles */
.container {
    background-color: #222;
    color: #bbb;
    margin: 20px auto;
    overflow: hidden;
    padding: 20px;
    position: relative;
    width: 800px;
}
.container h2 {
    color: #fff;
    margin-bottom: 10px;
}
.column {
    float: left;
    width: 48%;
}
.column:first-child {
    margin-right: 4%;
}
.column &gt; * {
    color: #ddd;
    margin-bottom: 10px;
}

/* tabs section */
.tabs_container {
    margin: 0;
}
.tabs {
    overflow: hidden;
}
.tabs li {
    float: left;
    list-style: none;
}
.tabs li h3:first-child {
    margin-left: 10px
}
.tabs li h3 {
    border: 1px solid #ddd;
    border-bottom-width: 0;
    display: block;
    margin: 0 2px 0 0;
    padding: 6px 10px 4px
}
.tabs li.active h3 {
    background-color: #555;
    border: 1px solid #ddd;
    border-bottom-width: 0;

    -moz-border-radius: 4px 4px 0 0;
    -ms-border-radius: 4px 4px 0 0;
    -o-border-radius: 4px 4px 0 0;
    -webkit-border-radius: 4px 4px 0 0;
    border-radius: 4px 4px 0 0;
}
.tabs li h3:hover {
    background-color: #666;
    cursor: pointer;
}
.tabs li.active h3:hover {
    background-color: #555;
    cursor: normal;
}
.nav_container form {
    background-color: #555;
    display: block;
    padding: 15px;
}
.column h3 {
    color: #fff;
}
.login_form input,.login_form label,
.join_form input,.join_form label {
    display: block;
    margin-bottom: 10px;
}
input[type=text], input[type=password], input[type=submit] {
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
input[type=text], input[type=password] {
    font-size: 16px;
    height: 25px;
    margin-right: 10px;
    width: 200px;
}
input[type=submit]{
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    height: 35px;
    padding: 5px;
}

/* chat block */
.chat_messages {
    border: 1px solid #888;
    box-shadow: 0 0 5px #AAA;
    color: #000;
    padding: 10px;
}
.chat_messages h2 {
    color: #fff;
}
.chat_messages .message {
    background-color: #fff;
    margin: 5px;
    padding: 5px;

    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
.chat_messages .message span {
    color: #444;
    font-size: 10px;
    margin-left: 10px;
}
.chat_submit_form {
    margin: 10px 0px;
}
.chat_submit_form div {
    float: left;
    width: 49%;
}
.chat_submit_form .error, .chat_submit_form .success, .chat_submit_form .protect {
    display: none;
}
.chat_submit_form .error {
    color: #f55;
}
.chat_submit_form .success {
    color: #5f5;
}
.chat_submit_form .protect {
    color: #55f;
}
</pre><h3>Step 4. PHP</h3><p>Now, lets review php sources. Our index.php file has updated. I have added here join processing functional. Before actual joining, we have to check if someone else was joined with same email (this field should be unique of course)</p><h4>index.php</h4><pre class="brush:php">
&lt;?php

// set error reporting level
if (version_compare(phpversion(), '5.3.0', '&gt;=') == 1)
  error_reporting(E_ALL &amp; ~E_NOTICE &amp; ~E_DEPRECATED);
else
  error_reporting(E_ALL &amp; ~E_NOTICE);

require_once('classes/Services_JSON.php');
require_once('classes/CMySQL.php'); // including service class to work with database
require_once('classes/CLogin.php'); // including service class to work with login processing

$sErrors = '';
// join processing
if (! isset($_SESSION['member_id']) &amp;&amp; $_POST['Join'] == 'Join') {
    $sUsername = $GLOBALS['MySQL']-&gt;escape($_POST['username']);
    $sFirstname = $GLOBALS['MySQL']-&gt;escape($_POST['firstname']);
    $sLastname = $GLOBALS['MySQL']-&gt;escape($_POST['lastname']);
    $sEmail = $GLOBALS['MySQL']-&gt;escape($_POST['email']);
    $sPassword = $GLOBALS['MySQL']-&gt;escape($_POST['password']);

    if ($sUsername &amp;&amp; $sEmail &amp;&amp; $sPassword) {
        // check if already exist
        $aProfile = $GLOBALS['MySQL']-&gt;getRow(&quot;SELECT * FROM `cs_profiles` WHERE `email`='{$sEmail}'&quot;);
        if ($aProfile['id'] &gt; 0) {
            $sErrors = '&lt;h2&gt;Another profile with same email already exist&lt;/h2&gt;';
        } else {
            // generate Salt and Cached password
            $sSalt = 'testing'; // TODO - we will add generation of salt in future
            $sPass = sha1(md5($sPassword) . $sSalt);

            // add new member into database
            $sSQL = &quot;
                INSERT INTO `cs_profiles` SET
                `name` = '{$sUsername}',
                `first_name` = '{$sFirstname}',
                `last_name` = '{$sLastname}',
                `email` = '{$sEmail}',
                `password` = '{$sPass}',
                `salt` = '{$sSalt}',
                `status` = 'active',
                `role` = '1',
                `date_reg` = NOW();
            &quot;;
            $GLOBALS['MySQL']-&gt;res($sSQL);

            // autologin
            $GLOBALS['CLogin']-&gt;performLogin($sUsername, $sPassword);
        }
    }
}

// login system init and generation code
$sLoginForm = $GLOBALS['CLogin']-&gt;getLoginBox();

$sChat = '&lt;h2&gt;You do not have rights to use chat&lt;/h2&gt;';
$sInput = '';
if ($_SESSION['member_id'] &amp;&amp; $_SESSION['member_status'] == 'active' &amp;&amp; $_SESSION['member_role']) {
    require_once('classes/CChat.php'); // including service class to work with chat

    // get last messages
    $sChat = $GLOBALS['MainChat']-&gt;getMessages();
    if ($_GET['action'] == 'get_last_messages') { // regular updating of messages in chat
        $oJson = new Services_JSON();
        header('Content-type: application/json');
        echo $oJson-&gt;encode(array('messages' =&gt; $sChat));
        exit;
    }

    // get input form
    $sInput = $GLOBALS['MainChat']-&gt;getInputForm();

    if ($_POST['message']) { // POST-ing of message
        $iRes = $GLOBALS['MainChat']-&gt;acceptMessage();

        $oJson = new Services_JSON();
        header('Content-type: application/json');
        echo $oJson-&gt;encode(array('result' =&gt; $iRes));
        exit;
    }
}

// draw common page
echo strtr(file_get_contents('templates/main_page.html'), array('{form}' =&gt; $sLoginForm . $sErrors, '{chat}' =&gt; $sChat, '{input}' =&gt; $sInput));
</pre><p>As you can see &#8211; I have added chat functionality today.</p><h4>classes/CLogin.php</h4><pre class="brush:php">
&lt;?php

class CLogin {

    // constructor
    function CLogin() {
        session_start();
    }

    // get login box function
    function getLoginBox() {
        if (isset($_GET['logout'])) { // logout processing
            if (isset($_SESSION['member_name']) &amp;&amp; isset($_SESSION['member_pass']))
                $this-&gt;performLogout();
        }

        if ($_POST &amp;&amp; $_POST['Login'] == 'Login' &amp;&amp; $_POST['username'] &amp;&amp; $_POST['password']) { // login processing
            if ($this-&gt;checkLogin($_POST['username'], $_POST['password'], false)) { // successful login
                $this-&gt;performLogin($_POST['username'], $_POST['password']);
                header( &quot;Location:{$_SERVER['REQUEST_URI']}&quot; );
                exit;
            } else { // wrong login
                return file_get_contents('templates/login_form.html') . '&lt;h2&gt;Username or Password is incorrect&lt;/h2&gt;';
            }
        } else { // in case if we already logged (on refresh page):
            if (isset($_SESSION['member_name']) &amp;&amp; $_SESSION['member_name'] &amp;&amp; $_SESSION['member_pass']) {
                $aReplaces = array(
                    '{name}' =&gt; $_SESSION['member_name'],
                    '{status}' =&gt; $_SESSION['member_status'],
                    '{role}' =&gt; $_SESSION['member_role'],
                );
                return strtr(file_get_contents('templates/logout_form.html'), $aReplaces);
            }

            // otherwise - draw login form
            return file_get_contents('templates/login_form.html');
        }
    }

    // perform login
    function performLogin($sName, $sPass) {
        $this-&gt;performLogout();

        // make variables safe
        $sName = $GLOBALS['MySQL']-&gt;escape($sName);

        $aProfile = $GLOBALS['MySQL']-&gt;getRow(&quot;SELECT * FROM `cs_profiles` WHERE `name`='{$sName}'&quot;);
        // $sPassEn = $aProfile['password'];
        $iPid = $aProfile['id'];
        $sSalt = $aProfile['salt'];
        $sStatus = $aProfile['status'];
        $sRole = $aProfile['role'];

        $sPass = sha1(md5($sPass) . $sSalt);

        $_SESSION['member_id'] = $iPid;
        $_SESSION['member_name'] = $sName;
        $_SESSION['member_pass'] = $sPass;
        $_SESSION['member_status'] = $sStatus;
        $_SESSION['member_role'] = $sRole;
    }

    // perform logout
    function performLogout() {
        unset($_SESSION['member_id']);
        unset($_SESSION['member_name']);
        unset($_SESSION['member_pass']);
        unset($_SESSION['member_status']);
        unset($_SESSION['member_role']);
    }

    // check login
    function checkLogin($sName, $sPass, $isHash = true) {
        // make variables safe
        $sName = $GLOBALS['MySQL']-&gt;escape($sName);
        $sPass = $GLOBALS['MySQL']-&gt;escape($sPass);

        $aProfile = $GLOBALS['MySQL']-&gt;getRow(&quot;SELECT * FROM `cs_profiles` WHERE `name`='{$sName}'&quot;);
        $sPassEn = $aProfile['password'];

        if ($sName &amp;&amp; $sPass &amp;&amp; $sPassEn) {
            if (! $isHash) {
                $sSalt = $aProfile['salt'];
                $sPass = sha1(md5($sPass) . $sSalt);
            }
            return ($sPass == $sPassEn);
        }
        return false;
    }
}

$GLOBALS['CLogin'] = new CLogin();
</pre><p>Minor changes were made in this file too. The rest of the functional was not changed. We will continue enhance our chat soon.</p><hr
/><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - demo 226" href="http://www.script-tutorials.com/demos/226/index.php" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - package" href="http://www.script-tutorials.com/demos/226/source.zip" target="_blank" rel="nofollow">download in archive</a></strong></h5><hr
/><h3>Conclusion</h3><p>I hope that our new series of articles of chat system creation is useful and interesting for you. If you want to share your ideas, or you noticed any weakness &#8211; don&#8217;t hesitate to contact us. Good luck and welcome back!</p><div
class="shr-publisher-1396"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-2/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/221/thumb.png" alt="Powerful Chat System &#8211; Lesson 2" /> <br
/> Powerful Chat System &#8211; Lesson 2</a></li><li> <a
href="http://www.script-tutorials.com/powerful-chat-system/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/218/thumb.png" alt="Powerful Chat System" /> <br
/> Powerful Chat System</a></li><li> <a
href="http://www.script-tutorials.com/how-to-easily-make-ajax-style-php-chat-application/" rel="bookmark"> <img
src="/ssimages/no_image.gif" alt="How to Easily Make AJAX Style PHP Chat Application" /> <br
/> How to Easily Make AJAX Style PHP Chat Application</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/powerful-chat-system-lesson-3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Powerful Chat System &#8211; Lesson 2</title><link>http://www.script-tutorials.com/powerful-chat-system-lesson-2/</link> <comments>http://www.script-tutorials.com/powerful-chat-system-lesson-2/#comments</comments> <pubDate>Wed, 18 Jan 2012 17:17:45 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[AJAX]]></category> <category><![CDATA[HTML/CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[ajax chat]]></category> <category><![CDATA[chat]]></category> <category><![CDATA[chat system]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1373</guid> <description><![CDATA[Powerful Chat System &#8211; Lesson 2 Today we continue a series of articles on the creation of powerful chat system. Our second lesson will contain next elements: smart chat (ajax, with spam filtering &#8211; protection from the frequent messages). I have decided to make registration for next lesson. Hope that it is ok for you. [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-3/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/226/thumb.png" alt="Powerful Chat System &#8211; Lesson 3" /> Powerful Chat System &#8211; Lesson 3</a></li><li> <a
href="http://www.script-tutorials.com/powerful-chat-system/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/218/thumb.png" alt="Powerful Chat System" /> Powerful Chat System</a></li><li> <a
href="http://www.script-tutorials.com/how-to-easily-make-ajax-style-php-chat-application/" rel="bookmark"> <img
src="/ssimages/no_image.gif" alt="How to Easily Make AJAX Style PHP Chat Application" /> How to Easily Make AJAX Style PHP Chat Application</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Powerful Chat System" alt="Powerful Chat System" src="http://www.script-tutorials.com/demos/221/thumb.png"></div><p><strong>Powerful Chat System &#8211; Lesson 2</strong><br
/> <br
/>Today we continue a series of articles on the creation of powerful chat system. Our second lesson will contain next elements: smart chat (ajax, with spam filtering &#8211; protection from the frequent messages). I have decided to make registration for next lesson. Hope that it is ok for you.<br
/> <span
id="more-1373"></span></p><p>Today I have included next elements: chat processor, plus &#8211; slight corrections in our previous sources. All project is well structured: system classes is in &#8216;classes&#8217; folder, stylesheets in &#8216;css&#8217; folder, template files in &#8216;templates&#8217; folder, and &#8211; new folder &#8216;js&#8217; for javascript files.</p><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - demo 221" href="http://www.script-tutorials.com/demos/221/index.php" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - package" href="http://www.script-tutorials.com/demos/221/source.zip" target="_blank">download in package</a></strong></h5><hr
/><p>Now &#8211; download the source files and lets start coding !</p><hr
/><h3>Step 1. SQL</h3><p>This table has got minor changes. I have changed type of field &#8216;when&#8217;.</p><pre class="brush:sql">
CREATE TABLE `cs_messages` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `sender` int(11) unsigned NOT NULL,
  `recipient` int(11) unsigned NOT NULL default '0',
  `message` VARCHAR(255) NOT NULL,
  `when` int(11) NOT NULL default '0',
  `room` int(5) unsigned NOT NULL default '0',
  `type` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
</pre><h3>Step 2. HTML</h3><p>This is main (index) page html markup:</p><h4>templates/main_page.html</h4><pre class="brush:html">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot; &gt;
&lt;head&gt;
    &lt;title&gt;Powerful Chat System - Lesson 2&lt;/title&gt;
    &lt;link href=&quot;css/main.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
    &lt;script src=&quot;http://code.jquery.com/jquery-latest.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;header&gt;
        &lt;h2&gt;Powerful Chat System - Lesson 2&lt;/h2&gt;
        &lt;a href=&quot;http://www.script-tutorials.com/powerful-chat-system-lesson-2/&quot; class=&quot;stuts&quot;&gt;Back to original tutorial on &lt;span&gt;Script Tutorials&lt;/span&gt;&lt;/a&gt;
    &lt;/header&gt;
    &lt;div class=&quot;container&quot;&gt;
        {form}
    &lt;/div&gt;
    &lt;div class=&quot;container&quot;&gt;
        &lt;h2&gt;Main Chat Block&lt;/h2&gt;
        &lt;div class=&quot;chat_messages&quot;&gt;
            {chat}
        &lt;/div&gt;
        {input}
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre><p>As you can see &#8211; I have changed our second container (which contains our ajax chat).</p><h4>templates/login_form.html and templates/logout_form.html</h4><p>These files haven&#8217;t changed since last time. Next one new template &#8211; chat form:</p><h4>templates/chat.html</h4><pre class="brush:html">
&lt;form class=&quot;chat_submit_form&quot;&gt;
    &lt;div&gt;&lt;input type=&quot;text&quot; name=&quot;message&quot; /&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;Submit&quot; /&gt;&lt;/div&gt;
    &lt;div&gt;
        &lt;h3 class=&quot;error&quot;&gt;Some error occurs during sending message&lt;/h3&gt;
        &lt;h3 class=&quot;success&quot;&gt;Message successfully sent&lt;/h3&gt;
        &lt;h3 class=&quot;protect&quot;&gt;Please wait 5 secs before adding next message&lt;/h3&gt;
    &lt;/div&gt;
&lt;/form&gt;
&lt;script src=&quot;js/chat.js&quot;&gt;&lt;/script&gt;
</pre><h3>Step 3. CSS</h3><p>This file contains updated styles of our chat</p><h4>css/main.css</h4><pre class="brush:html">
/* page layout */
*{
    margin:0;
    padding:0;
}
body {
    background-color:#eee;
    color:#fff;
    font:14px/1.3 Arial,sans-serif;
}
header {
    background-color:#212121;
    box-shadow: 0 -1px 2px #111111;
    display:block;
    height:70px;
    position:relative;
    width:100%;
    z-index:100;
}
header h2{
    font-size:22px;
    font-weight:normal;
    left:50%;
    margin-left:-400px;
    padding:22px 0;
    position:absolute;
    width:540px;
}
header a.stuts,a.stuts:visited{
    border:none;
    text-decoration:none;
    color:#fcfcfc;
    font-size:14px;
    left:50%;
    line-height:31px;
    margin:23px 0 0 110px;
    position:absolute;
    top:0;
}
header .stuts span {
    font-size:22px;
    font-weight:bold;
    margin-left:5px;
}

/* main styles */
.container {
    background-color: #222;
    color: #bbb;
    margin: 20px auto;
    overflow: hidden;
    padding: 20px;
    position: relative;
    width: 800px;
}
.container h2 {
    color: #fff;
    margin-bottom: 10px;
}
.column {
    float: left;
    width: 48%;
}
.column:first-child {
    margin-right: 4%;
}
.column &gt; * {
    color: #ddd;
    margin-bottom: 10px;
}
.column h3 {
    color: #fff;
}
.login_form input,.login_form label {
    display: block;
    margin-bottom: 10px;
}
input[type=text], input[type=password], input[type=submit] {
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
input[type=text], input[type=password] {
    font-size: 16px;
    height: 30px;
    margin-right: 10px;
    width: 200px;
}
input[type=submit]{
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    height: 35px;
    padding: 5px;
}

/* chat block */
.chat_messages {
    border: 1px solid #888;
    box-shadow: 0 0 5px #AAA;
    color: #000;
    padding: 10px;
}
.chat_messages h2 {
    color: #fff;
}
.chat_messages .message {
    background-color: #fff;
    margin: 5px;
    padding: 5px;

    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
.chat_messages .message span {
    color: #444;
    font-size: 10px;
    margin-left: 10px;
}
.chat_submit_form {
    margin: 10px 0px;
}
.chat_submit_form div {
    float: left;
    width: 49%;
}
.chat_submit_form .error, .chat_submit_form .success, .chat_submit_form .protect {
    display: none;
}
.chat_submit_form .error {
    color: #f55;
}
.chat_submit_form .success {
    color: #5f5;
}
.chat_submit_form .protect {
    color: #55f;
}
</pre><h3>Step 4. JS</h3><p>I have created first JS for our chat. At beginning &#8211; it contain one function for regular obtaining messages, and handler of form submitting.</p><h4>js/chat.js</h4><pre class="brush:js">
$(function() {
    getMessages = function() {
        $.getJSON('index.php?action=get_last_messages', function(data){
            if (data.messages) {
                $('.chat_messages').html(data.messages);
            }

            // get recent chat messages in loop
            setTimeout(function(){
               getMessages();
            }, 5000);
        });
    }
    getMessages();

    $('.chat_submit_form').submit(function() {
        $.post('index.php', { message: $('.chat_submit_form input[name=message]').val() },
            function(data){
                if (data.result == 1) {
                    $('.chat_submit_form .success').fadeIn('slow', function () {
                        $(this).delay(1000).fadeOut('slow');
                    });
                } else if (data.result == 2) {
                    $('.chat_submit_form .protect').fadeIn('slow', function () {
                        $(this).delay(1000).fadeOut('slow');
                    });
                } else {
                    $('.chat_submit_form .error').fadeIn('slow', function () {
                        $(this).delay(1000).fadeOut('slow');
                    });
                }
            }
        );
        return false;
    });
});
</pre><h3>Step 5. PHP</h3><p>Now, lets review php sources:</p><h4>index.php</h4><pre class="brush:php">
&lt;?php

// set error reporting level
if (version_compare(phpversion(), '5.3.0', '&gt;=') == 1)
  error_reporting(E_ALL &amp; ~E_NOTICE &amp; ~E_DEPRECATED);
else
  error_reporting(E_ALL &amp; ~E_NOTICE);

require_once('classes/Services_JSON.php');
require_once('classes/CMySQL.php'); // including service class to work with database
require_once('classes/CLogin.php'); // including service class to work with login processing

// login system init and generation code
$sLoginForm = $GLOBALS['CLogin']-&gt;getLoginBox();

$sChat = '&lt;h2&gt;You do not have rights to use chat&lt;/h2&gt;';
$sInput = '';
if ($_SESSION['member_id'] &amp;&amp; $_SESSION['member_status'] == 'active' &amp;&amp; $_SESSION['member_role']) {
    require_once('classes/CChat.php'); // including service class to work with chat

    // get last messages
    $sChat = $GLOBALS['MainChat']-&gt;getMessages();
    if ($_GET['action'] == 'get_last_messages') { // regular updating of messages in chat
        $oJson = new Services_JSON();
        header('Content-type: application/json');
        echo $oJson-&gt;encode(array('messages' =&gt; $sChat));
        exit;
    }

    // get input form
    $sInput = $GLOBALS['MainChat']-&gt;getInputForm();

    if ($_POST['message']) { // POST-ing of message
        $iRes = $GLOBALS['MainChat']-&gt;acceptMessage();

        $oJson = new Services_JSON();
        header('Content-type: application/json');
        echo $oJson-&gt;encode(array('result' =&gt; $iRes));
        exit;
    }
}

// draw common page
echo strtr(file_get_contents('templates/main_page.html'), array('{form}' =&gt; $sLoginForm, '{chat}' =&gt; $sChat, '{input}' =&gt; $sInput));
</pre><p>As you can see &#8211; I have added chat functionality today.</p><h4>classes/CLogin.php</h4><pre class="brush:php">
&lt;?php

class CLogin {

    // constructor
    function CLogin() {
        session_start();
    }

    // get login box function
    function getLoginBox() {
        if (isset($_GET['logout'])) { // logout processing
            if (isset($_SESSION['member_name']) &amp;&amp; isset($_SESSION['member_pass']))
                $this-&gt;performLogout();
        }

        if ($_POST &amp;&amp; $_POST['username'] &amp;&amp; $_POST['password']) { // login processing
            if ($this-&gt;checkLogin($_POST['username'], $_POST['password'], false)) { // successful login
                $this-&gt;performLogin($_POST['username'], $_POST['password']);
                header( &quot;Location:{$_SERVER['REQUEST_URI']}&quot; );
                exit;
            } else { // wrong login
                return file_get_contents('templates/login_form.html') . '&lt;h2&gt;Username or Password is incorrect&lt;/h2&gt;';
            }
        } else { // in case if we already logged (on refresh page):
            if (isset($_SESSION['member_name']) &amp;&amp; $_SESSION['member_name'] &amp;&amp; $_SESSION['member_pass']) {
                $aReplaces = array(
                    '{name}' =&gt; $_SESSION['member_name'],
                    '{status}' =&gt; $_SESSION['member_status'],
                    '{role}' =&gt; $_SESSION['member_role'],
                );
                return strtr(file_get_contents('templates/logout_form.html'), $aReplaces);
            }

            // otherwise - draw login form
            return file_get_contents('templates/login_form.html');
        }
    }

    // perform login
    function performLogin($sName, $sPass) {
        $this-&gt;performLogout();

        // make variables safe
        $sName = $GLOBALS['MySQL']-&gt;escape($sName);

        $aProfile = $GLOBALS['MySQL']-&gt;getRow(&quot;SELECT * FROM `cs_profiles` WHERE `name`='{$sName}'&quot;);
        // $sPassEn = $aProfile['password'];
        $iPid = $aProfile['id'];
        $sSalt = $aProfile['salt'];
        $sStatus = $aProfile['status'];
        $sRole = $aProfile['role'];

        $sPass = sha1(md5($sPass) . $sSalt);

        $_SESSION['member_id'] = $iPid;
        $_SESSION['member_name'] = $sName;
        $_SESSION['member_pass'] = $sPass;
        $_SESSION['member_status'] = $sStatus;
        $_SESSION['member_role'] = $sRole;
    }

    // perform logout
    function performLogout() {
        unset($_SESSION['member_id']);
        unset($_SESSION['member_name']);
        unset($_SESSION['member_pass']);
        unset($_SESSION['member_status']);
        unset($_SESSION['member_role']);
    }

    // check login
    function checkLogin($sName, $sPass, $isHash = true) {
        // make variables safe
        $sName = $GLOBALS['MySQL']-&gt;escape($sName);
        $sPass = $GLOBALS['MySQL']-&gt;escape($sPass);

        $aProfile = $GLOBALS['MySQL']-&gt;getRow(&quot;SELECT * FROM `cs_profiles` WHERE `name`='{$sName}'&quot;);
        $sPassEn = $aProfile['password'];

        if ($sName &amp;&amp; $sPass &amp;&amp; $sPassEn) {
            if (! $isHash) {
                $sSalt = $aProfile['salt'];
                $sPass = sha1(md5($sPass) . $sSalt);
            }
            return ($sPass == $sPassEn);
        }
        return false;
    }
}

$GLOBALS['CLogin'] = new CLogin();
</pre><p>This class is updated too. I have decided to add &#8216;member_id&#8217; in sessions too. It will useful afterward.</p><h4>classes/CMySQL.php</h4><p>This is database service class. Available in package. Pay attention &#8211; database settings of our project is in this file.</p><h4>classes/Services_JSON.php</h4><p>This is JSON service class. Available in package.</p><h4>classes/CChat.php</h4><pre class="brush:php">
&lt;?php

class CChat {

    // constructor
    function CChat() {}

    // add to DB message
    function acceptMessage() {
        $sName = $GLOBALS['MySQL']-&gt;escape($_SESSION['member_name']);
        $iPid = (int)$_SESSION['member_id'];
        $sMessage = $GLOBALS['MySQL']-&gt;escape($_POST['message']);

        if ($iPid &amp;&amp; $sName != '' &amp;&amp; $sMessage != '') {
            $sSQL = &quot;
                SELECT `id`
                FROM `cs_messages`
                WHERE `sender` = '{$iPid}' AND UNIX_TIMESTAMP( ) - `when` &lt; 5
                LIMIT 1
            &quot;;
            $iLastId = $GLOBALS['MySQL']-&gt;getOne($sSQL);
            if ($iLastId) return 2; // as protection from very often messages

            $bRes = $GLOBALS['MySQL']-&gt;res(&quot;INSERT INTO `cs_messages` SET `sender` = '{$iPid}', `message` = '{$sMessage}', `when` = UNIX_TIMESTAMP()&quot;);
            return ($bRes) ? 1 : 3;
        }
    }

    // return input text form
    function getInputForm() {
        return file_get_contents('templates/chat.html');
    }

    // get last 10 messages
    function getMessages() {
        $sSQL = &quot;
            SELECT `a` . * , `cs_profiles`.`name` , UNIX_TIMESTAMP( ) - `a`.`when` AS 'diff'
            FROM `cs_messages` AS `a`
            INNER JOIN `cs_profiles` ON `cs_profiles`.`id` = `a`.`sender`
            ORDER BY `a`.`id` DESC
            LIMIT 10
        &quot;;
        $aMessages = $GLOBALS['MySQL']-&gt;getAll($sSQL);
        asort($aMessages);

        // create list of messages
        $sMessages = '';
        foreach ($aMessages as $i =&gt; $aMessage) {
            $sExStyles = $sExJS = '';
            $iDiff = (int)$aMessage['diff'];
            if ($iDiff &lt; 7) { // less than 7 seconds
                $sExStyles = 'style=&quot;display:none;&quot;';
                $sExJS = &quot;&lt;script&gt; $('#message_{$aMessage['id']}').fadeIn('slow'); &lt;/script&gt;&quot;;
            }

            $sWhen = date(&quot;H:i:s&quot;, $aMessage['when']);
            $sMessages .= '&lt;div class=&quot;message&quot; id=&quot;message_'.$aMessage['id'].'&quot; '.$sExStyles.'&gt;&lt;b&gt;' . $aMessage['name'] . ':&lt;/b&gt; ' . $aMessage['message'] . '&lt;span&gt;(' . $sWhen . ')&lt;/span&gt;&lt;/div&gt;' . $sExJS;
        }
        return $sMessages;
    }
}

$GLOBALS['MainChat'] = new CChat();
</pre><p>This is our new class for chat processor. For now &#8211; it contain only 3 functions: acceptMessage, getInputForm and getMessages.</p><hr
/><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - demo 221" href="http://www.script-tutorials.com/demos/221/index.php" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - package" href="http://www.script-tutorials.com/demos/221/source.zip" target="_blank" rel="nofollow">download in archive</a></strong></h5><hr
/><h3>Conclusion</h3><p>I will hope that our new series of articles of chat system creation will be useful and interesting for you. If you want to share your ideas, or you noticed any weakness &#8211; don&#8217;t hesitate to contact us. Good luck and welcome back!</p><div
class="shr-publisher-1373"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-3/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/226/thumb.png" alt="Powerful Chat System &#8211; Lesson 3" /> <br
/> Powerful Chat System &#8211; Lesson 3</a></li><li> <a
href="http://www.script-tutorials.com/powerful-chat-system/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/218/thumb.png" alt="Powerful Chat System" /> <br
/> Powerful Chat System</a></li><li> <a
href="http://www.script-tutorials.com/how-to-easily-make-ajax-style-php-chat-application/" rel="bookmark"> <img
src="/ssimages/no_image.gif" alt="How to Easily Make AJAX Style PHP Chat Application" /> <br
/> How to Easily Make AJAX Style PHP Chat Application</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/powerful-chat-system-lesson-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Isometric interactive interior guide</title><link>http://www.script-tutorials.com/isometric-interactive-interior-guide/</link> <comments>http://www.script-tutorials.com/isometric-interactive-interior-guide/#comments</comments> <pubDate>Tue, 17 Jan 2012 17:37:15 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[HTML/CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[inspiration]]></category> <category><![CDATA[interactive guide]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1369</guid> <description><![CDATA[Isometric interactive interior guide During browsing internet, I have noticed new interesting thing &#8211; it looked like isometric guide. Today I will show you how you can create something similar. We will create isometric interactive interior guide with CSS3 and jQuery. Here are samples and downloadable package: Live Demo download in package Ok, download the [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/how-to-create-dialogs-using-ui-dialog/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/40.png" alt="How to create Animated Dialogs using UI Dialog (jQuery)" /> How to create Animated Dialogs using UI Dialog (jQuery)</a></li><li> <a
href="http://www.script-tutorials.com/html5-game-development-lesson-5/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/205/thumb.png" alt="HTML5 Game Development &#8211; Lesson 5" /> HTML5 Game Development &#8211; Lesson 5</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Isometric interactive interior guide" alt="Isometric interactive interior guide" src="http://www.script-tutorials.com/demos/220/thumb.png" /></div><p><strong>Isometric interactive interior guide</strong></p><p>During browsing internet, I have noticed new interesting thing &#8211; it looked like isometric guide. Today I will show you how you can create something similar. We will create isometric interactive interior guide with CSS3 and jQuery.</p><p><span
id="more-1369"></span></p><hr
/><p>Here are samples and downloadable package:</p><h5 style="text-align: center;"><strong><a
title="Isometric interactive interior guide - demo 220" href="http://www.script-tutorials.com/demos/220/index.html" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Isometric interactive interior guide - package" href="http://www.script-tutorials.com/demos/220/source.zip" target="_blank">download in package</a></strong></h5><hr
/><p>Ok, download the example files and lets start coding !</p><hr
/><h3>Step 1. HTML</h3><p>As usual, we start with the HTML. Here is full html code of our guide page. You can see here main scene (container object), six labels on this scene (with some description), and empty dialog element.</p><h4>index.html</h4><pre class="brush:html">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot; &gt;
    &lt;head&gt;
        &lt;meta charset=&quot;utf-8&quot; /&gt;
        &lt;title&gt;Isometric interactive interior guide with CSS3 and jQuery | Script Tutorials&lt;/title&gt;
        &lt;link href=&quot;css/layout.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;&gt;
        &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js&quot;&gt;&lt;/script&gt;
        &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;js/main.js&quot;&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;header&gt;
            &lt;h2&gt;Isometric interactive interior guide&lt;/h2&gt;
            &lt;a href=&quot;http://www.script-tutorials.com/isometric-interactive-interior-guide/&quot; class=&quot;stuts&quot;&gt;Back to original tutorial on &lt;span&gt;Script Tutorials&lt;/span&gt;&lt;/a&gt;
        &lt;/header&gt;

        &lt;div class=&quot;container&quot;&gt;
            &lt;div class=&quot;labels&quot;&gt;
                &lt;a id=&quot;label1&quot; class=&quot;label&quot; href=&quot;#&quot;&gt;sofa
                    &lt;p&gt;A sofa, is an item of furniture designed to seat more than one person, and providing support for the back and arms.&lt;/p&gt;
                    &lt;span /&gt;
                &lt;/a&gt;
                &lt;a id=&quot;label2&quot; class=&quot;label&quot; href=&quot;#&quot;&gt;television
                    &lt;p&gt;Television (TV) is a telecommunication medium for transmitting and receiving moving images that can be monochrome (black-and-white) or colored, with or without accompanying sound.&lt;/p&gt;
                    &lt;span /&gt;
                &lt;/a&gt;
                &lt;a id=&quot;label3&quot; class=&quot;label&quot; href=&quot;#&quot;&gt;chest
                    &lt;p&gt;In many video games, especially role-playing video games, treasure chests contain various items, currency, and sometimes monsters.&lt;/p&gt;
                    &lt;span /&gt;
                &lt;/a&gt;
                &lt;a id=&quot;label4&quot; class=&quot;label&quot; href=&quot;#&quot;&gt;workplace
                    &lt;p&gt;A virtual workplace is a workplace that is not located in any one physical space.&lt;/p&gt;
                    &lt;span /&gt;
                &lt;/a&gt;
                &lt;a id=&quot;label5&quot; class=&quot;label&quot; href=&quot;#&quot;&gt;entrance
                    &lt;p&gt;A door is a movable structure used to open and close off an entrance, typically consisting of a panel that swings on hinges or that slides or rotates inside of a space.&lt;/p&gt;
                    &lt;span /&gt;
                &lt;/a&gt;
                &lt;a id=&quot;label6&quot; class=&quot;label&quot; href=&quot;#&quot;&gt;safe room
                    &lt;p&gt;A safe room or panic room is a fortified room which is installed in a private residence or business to provide a safe shelter, or hiding place, for the inhabitants in the event of a break-in, home invasion, tornado, or other threat.&lt;/p&gt;
                    &lt;span /&gt;
                &lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;dialog&quot;&gt;
                &lt;p&gt;&lt;/p&gt;
                &lt;a class=&quot;close&quot;&gt;X&lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre><h3>Step 2. CSS</h3><p>Now &#8211; CSS styles. Which I have separated into two parts: common page styles and styles of our main scene.</p><h4>css/layout.css</h4><pre class="brush:css">
/* page layout styles */
*{
    margin:0;
    padding:0;
}
body {
    background-color:#fefffa;
    color:#fff;
    font:14px/1.3 Arial,sans-serif;
}
header {
    background-color:#212121;
    box-shadow: 0 -1px 2px #111111;
    display:block;
    height:70px;
    position:relative;
    width:100%;
    z-index:100;
}
header h2{
    font-size: 22px;
    font-weight: normal;
    left: 40%;
    margin-left: -300px;
    padding: 22px 0;
    position: absolute;
    width: 1000px;
}
header a.stuts,a.stuts:visited{
    border: none;
    color: #FCFCFC;
    font-size: 14px;
    left: 50%;
    line-height: 31px;
    margin: 23px 0 0 110px;
    position: absolute;
    text-decoration: none;
    top: 0;
}
header .stuts span {
    font-size:22px;
    font-weight:bold;
    margin-left:5px;
}

/* demo */
.container {
    background: url(&quot;../images/scene.jpg&quot;) no-repeat scroll center top transparent;
    color: #000000;
    height: 535px;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
    width: 1030px;
}
.dialog {
    background-color: rgba(163, 154, 77, 0.9);
    color: #FFFFFF;
    display: none;
    height: 140px;
    left: 343px;
    line-height: 24px;
    padding: 100px 30px;
    position: absolute;
    text-align: center;
    top: 97px;
    width: 280px;
    z-index: 10;

    -moz-border-radius: 170px;
    -ms-border-radius: 170px;
    -o-border-radius: 170px;
    -webkit-border-radius: 170px;
    border-radius: 170px;
}
.dialog .close {
    background-color: #65683b;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    height: 36px;
    line-height: 36px;
    position: absolute;
    right: 10px;
    top: 60px;
    width: 36px;

    -moz-border-radius: 18px;
    -ms-border-radius: 18px;
    -o-border-radius: 18px;
    -webkit-border-radius: 18px;
    border-radius: 18px;
}
.labels p {
    display: none;
}
.labels a {
    background-color: rgba(203, 189, 58, 0.8);
    color: #FFFFFF;
    display: none;
    height: 50px;
    padding: 30px 0 0;
    position: absolute !important;
    text-align: center;
    text-decoration: none;
    width: 80px;

    -moz-border-radius: 40px;
    -ms-border-radius: 40px;
    -o-border-radius: 40px;
    -webkit-border-radius: 40px;
    border-radius: 40px;
}
.labels &gt; a {
    background-color: rgba(203, 189, 58, 0.8);

    -moz-transition: .3s;
    -ms-transition: .3s;
    -o-transition: .3s;
    -webkit-transition: .3s;
    transition: .3s;
}
.labels a:hover {
    background-color: rgba(128, 128, 128, 0.8);
}
.labels a span {
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid rgba(203, 189, 58, 0.8);
    bottom: -14px;
    height: 0;
    left: 30px;
    position: absolute;
    width: 0;

    -moz-transition: .3s;
    -ms-transition: .3s;
    -o-transition: .3s;
    -webkit-transition: .3s;
    transition: .3s;
}
.labels a:hover span {
    border-top: 15px solid rgba(128, 128, 128, 0.8);
}
#label1 {
    left: 720px;
    top: 215px;
}
#label2 {
    left: 495px;
    top: 290px;
}
#label3 {
    left: 450px;
    top: 115px;
}
#label4 {
    left: 270px;
    top: 170px;
}
#label5 {
    left: 570px;
    top: 65px;
}
#label6 {
    left: 275px;
    top: 30px;
}
</pre><h3>Step 3. JS</h3><p>And now &#8211; our jQuery code:</p><h4>js/main.js</h4><pre class="brush:js">
jQuery(function(){
    // initialize of labels
    $('.labels a#label1').fadeIn(100).effect('bounce', { times:3 }, 300, function() {
        $('.labels a#label2').fadeIn(100).effect('bounce', { times:3 }, 300, function() {
            $('.labels a#label3').fadeIn(100).effect('bounce', { times:3 }, 300, function() {
                $('.labels a#label4').fadeIn(100).effect('bounce', { times:3 }, 300, function() {
                    $('.labels a#label5').fadeIn(100).effect('bounce', { times:3 }, 300, function() {
                        $('.labels a#label6').fadeIn(100).effect('bounce', { times:3 }, 300);
                    });
                });
            });
        });
    });

    // dialog close
    $('.dialog .close').click(function() {
        $(this).parent().fadeOut(500);
        return false;
    });

    // display dialog on click by labels
    $('.labels a').click(function() {
        $('.dialog p').html( $(this).find('p').html() ).parent().fadeIn(500);
        return false;
    });

    // close dialog on click outside
    $('.container').click(function() {
        $('.dialog').fadeOut(500);
    });
});
</pre><p>Here are just a few event handlers of our scene objects.</p><hr
/><h5 style="text-align: center;"><strong><a
title="Isometric interactive interior guide - demo 220" href="http://www.script-tutorials.com/demos/220/index.html" target="_blank" rel="nofollow">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Isometric interactive interior guide - package" href="http://www.script-tutorials.com/demos/220/source.zip" target="_blank" rel="nofollow">download in package</a></strong></h5><hr
/><h3>Conclusion</h3><p>I will happy if our material will useful for you, and can bring you some inspiration. Don&#8217;t forget telling thanks and leaving a comment. <img
src='http://www.script-tutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Good luck!</p><div
class="shr-publisher-1369"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/how-to-create-dialogs-using-ui-dialog/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/40.png" alt="How to create Animated Dialogs using UI Dialog (jQuery)" /> <br
/> How to create Animated Dialogs using UI Dialog (jQuery)</a></li><li> <a
href="http://www.script-tutorials.com/html5-game-development-lesson-5/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/205/thumb.png" alt="HTML5 Game Development &#8211; Lesson 5" /> <br
/> HTML5 Game Development &#8211; Lesson 5</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/isometric-interactive-interior-guide/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Powerful Chat System</title><link>http://www.script-tutorials.com/powerful-chat-system/</link> <comments>http://www.script-tutorials.com/powerful-chat-system/#comments</comments> <pubDate>Fri, 13 Jan 2012 14:14:57 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[AJAX]]></category> <category><![CDATA[HTML/CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[ajax chat]]></category> <category><![CDATA[chat]]></category> <category><![CDATA[chat system]]></category> <category><![CDATA[profiles]]></category> <category><![CDATA[registration]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1360</guid> <description><![CDATA[Powerful Chat System Today we begin a series of articles on the creation of powerful chat system. The system will contain next elements: registration, login processing, main chat, profiles with avatars, ranking system (of profiles), private messaging, custom rooms, moderation / administration and possible something else (in future). This will be ajax chat PHP) with [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-3/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/226/thumb.png" alt="Powerful Chat System &#8211; Lesson 3" /> Powerful Chat System &#8211; Lesson 3</a></li><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-2/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/221/thumb.png" alt="Powerful Chat System &#8211; Lesson 2" /> Powerful Chat System &#8211; Lesson 2</a></li><li> <a
href="http://www.script-tutorials.com/how-to-easily-make-a-php-chat-application/" rel="bookmark"> <img
src="/ssimages/no_image.gif" alt="How to Easily Make a PHP Chat Application" /> How to Easily Make a PHP Chat Application</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Powerful Chat System" alt="Powerful Chat System" src="http://www.script-tutorials.com/demos/218/thumb.png"></div><p><strong>Powerful Chat System</strong><br
/> <br
/>Today we begin a series of articles on the creation of powerful chat system. The system will contain next elements: registration, login processing, main chat, profiles with avatars, ranking system (of profiles), private messaging, custom rooms, moderation / administration and possible something else (in future). This will be ajax chat PHP) with storing messages in database (MySQL). Plus we will implement CSS3/HTML5 features in our development process.<br
/> <span
id="more-1360"></span></p><p>Today I have included next elements: initial code (PHP + SQL) with login processor. All project will be well structured: system classes is in &#8216;classes&#8217; folder, stylesheets in &#8216;css&#8217; folder, template files in &#8216;templates&#8217; folder.</p><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - demo 218" href="http://www.script-tutorials.com/demos/218/index.php" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - package" href="http://www.script-tutorials.com/demos/218/source.zip" target="_blank">download in package</a></strong></h5><hr
/><p>Now &#8211; download the source files and lets start coding !</p><hr
/><h3>Step 1. SQL</h3><p>Here is SQL structure of tables for profiles and messages</p><pre class="brush:sql">
CREATE TABLE `cs_profiles` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `last_name` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `password` varchar(40) NOT NULL default '',
  `salt` varchar(10) NOT NULL default '',
  `status` enum('active','passive') NOT NULL default 'active',
  `role` tinyint(4) unsigned NOT NULL default '1',
  `about` varchar(255) NOT NULL,
  `date_reg` datetime NOT NULL default '0000-00-00 00:00:00',
  `rate` float NOT NULL,
  `rate_count` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

INSERT INTO `cs_profiles` (`name`, `last_name`, `email`, `password`, `salt`, `status`, `role`, `about`, `date_reg`, `rate`, `rate_count`) VALUES
('test user', 'test user last name', 'user@user.com', 'b88c654d6c68fc37f4dda1d29935235eea9a845b', 'testing', 'active', 1, 'Few words about test user', '2012-01-14 00:00:00', 0, 0),
('moderator', 'moderator last name', 'moderator@moderator.com', 'b88c654d6c68fc37f4dda1d29935235eea9a845b', 'testing', 'active', 4, 'Few words about moderator', '2012-01-14 00:00:00', 0, 0),
('admin', 'admin last name', 'admin@admin.com', 'b88c654d6c68fc37f4dda1d29935235eea9a845b', 'testing', 'active', 5, 'Few words about admin', '2012-01-14 00:00:00', 0, 0);

CREATE TABLE `cs_messages` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `sender` int(11) unsigned NOT NULL,
  `recipient` int(11) unsigned NOT NULL default '0',
  `message` VARCHAR(255) NOT NULL,
  `when` TIMESTAMP NOT NULL default CURRENT_TIMESTAMP,
  `room` int(5) unsigned NOT NULL default '0',
  `type` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
</pre><p>I have added 3 profiles in the system. Each of them have different role. I plan to make ordinary members (1), moderators (4), administrators (5). You can use another roles (as example 2 and 3) for any other purposes (paid members?). And, quite forgot &#8211; password for all of them is <b>&#8216;password&#8217;</b>. So you can login as &#8216;test user&#8217; -> &#8216;password&#8217;, &#8216;moderator&#8217; -> &#8216;password&#8217; and &#8216;admin&#8217; -> &#8216;password&#8217;. Registration process will in next article.</p><h3>Step 2. HTML</h3><p>This is main (index) page html markup:</p><h4>templates/main_page.html</h4><pre class="brush:html">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot; &gt;
&lt;head&gt;
    &lt;title&gt;Powerful Chat System&lt;/title&gt;
    &lt;link href=&quot;css/main.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;header&gt;
        &lt;h2&gt;Powerful Chat System&lt;/h2&gt;
        &lt;a href=&quot;http://www.script-tutorials.com/powerful-chat-system/&quot; class=&quot;stuts&quot;&gt;Back to original tutorial on &lt;span&gt;Script Tutorials&lt;/span&gt;&lt;/a&gt;
    &lt;/header&gt;
    &lt;div class=&quot;container&quot;&gt;
        {form}
    &lt;/div&gt;
    &lt;div class=&quot;container&quot;&gt;
        {chat}
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre><p>It is easy layout, isn&#8217;t it?. Now, next template file for login form:</p><h4>templates/login_form.html</h4><pre class="brush:html">
&lt;div class=&quot;column&quot;&gt;
    &lt;h3&gt;Powerful Chat System Demonstration&lt;/h3&gt;
    &lt;p&gt;Our chat will contain next features: registration, main chat, profiles with avatars, ranking system, private messaging, custom rooms, moderation / administration and possible something else (in future).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;column&quot;&gt;
    &lt;form class=&quot;login_form&quot; action=&quot;index.php&quot; method=&quot;post&quot;&gt;
        &lt;h3&gt;Log In&lt;/h3&gt;
        &lt;label&gt;Username:&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;username&quot;&gt;
        &lt;label&gt;Password:&lt;/label&gt;&lt;input type=&quot;password&quot; name=&quot;password&quot;&gt;
        &lt;input type=&quot;submit&quot; name=&quot;LogIn&quot; value=&quot;Login&quot;&gt;
    &lt;/form&gt;
&lt;/div&gt;
</pre><p>Next one template &#8211; logout form:</p><h4>logout_form.html</h4><pre class="brush:html">
&lt;div class=&quot;column&quot;&gt;
    &lt;h3&gt;Hello {name}&lt;/h3&gt;
    &lt;h3&gt;Your status:&lt;/h3&gt;
    &lt;div&gt;{status}&lt;/div&gt;
    &lt;h3&gt;Your role:&lt;/h3&gt;
    &lt;div&gt;{role}&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;column&quot;&gt;
    &lt;a href=&quot;index.php?logout&quot;&gt;Log Out&lt;/a&gt;
&lt;/div&gt;
</pre><h3>Step 3. CSS</h3><p>This file contains styles of our page layout</p><h4>css/main.css</h4><pre class="brush:html">
/* page layout */
*{
    margin:0;
    padding:0;
}
body {
    background-color:#eee;
    color:#fff;
    font:14px/1.3 Arial,sans-serif;
}
header {
    background-color:#212121;
    box-shadow: 0 -1px 2px #111111;
    display:block;
    height:70px;
    position:relative;
    width:100%;
    z-index:100;
}
header h2{
    font-size:22px;
    font-weight:normal;
    left:50%;
    margin-left:-400px;
    padding:22px 0;
    position:absolute;
    width:540px;
}
header a.stuts,a.stuts:visited{
    border:none;
    text-decoration:none;
    color:#fcfcfc;
    font-size:14px;
    left:50%;
    line-height:31px;
    margin:23px 0 0 110px;
    position:absolute;
    top:0;
}
header .stuts span {
    font-size:22px;
    font-weight:bold;
    margin-left:5px;
}

/* main styles */
.container {
    background-color:#222;
    color: #bbb;
    margin: 20px auto;
    overflow: hidden;
    padding:20px;
    position: relative;
    width: 800px;
}
.column {
    float:left;
    width:48%;
}
.column:first-child {
    margin-right:4%;
}
.column &gt; * {
    color:#ddd;
    margin-bottom:10px;
}
.column h3 {
    color:#fff;
}
.login_form input,.login_form label {
    display:block;
    margin-bottom:5px;
}
input[type=text],
input[type=password] {
    width:200px;
}
input[type=submit]{
    height:30px;
    margin-top:10px;
    width:72px;
}
</pre><h3>Step 4. PHP</h3><p>Now, lets review php sources:</p><h4>index.php</h4><pre class="brush:php">
&lt;?php

// set error reporting level
if (version_compare(phpversion(), &quot;5.3.0&quot;, &quot;&gt;=&quot;) == 1)
  error_reporting(E_ALL &amp; ~E_NOTICE &amp; ~E_DEPRECATED);
else
  error_reporting(E_ALL &amp; ~E_NOTICE);

require_once('classes/CMySQL.php'); // including service class to work with database
require_once('classes/CLogin.php'); // including service class to work with login processing

// login system init and generation code
$sLoginForm = $GLOBALS['CLogin']-&gt;getLoginBox();

$sChat = ($_SESSION['member_name'] &amp;&amp; $_SESSION['member_status'] == 'active') ? '&lt;h2&gt;TODO chat&lt;/h2&gt;' : '&lt;h2&gt;You have to login before use chat&lt;/h2&gt;';

echo strtr(file_get_contents('templates/main_page.html'), array('{form}' =&gt; $sLoginForm, '{chat}' =&gt; $sChat));
</pre><p>As we need only login processing for today &#8211; our index file is pretty small. New functional will appear in further articles. Here is sources of our login processor:</p><h4>classes/CLogin.php</h4><pre class="brush:php">
&lt;?php

class CLogin {

    // constructor
    function CLogin() {
        session_start();
    }

    // get login box function
    function getLoginBox() {
        if (isset($_GET['logout'])) { // logout processing
            if (isset($_SESSION['member_name']) &amp;&amp; isset($_SESSION['member_pass']))
                $this-&gt;performLogout();
        }

        if ($_POST &amp;&amp; $_POST['username'] &amp;&amp; $_POST['password']) { // login processing
            if ($this-&gt;checkLogin($_POST['username'], $_POST['password'], false)) { // successful login
                $this-&gt;performLogin($_POST['username'], $_POST['password']);
                header( &quot;Location:{$_SERVER['REQUEST_URI']}&quot; );
                exit;
            } else { // wrong login
                return file_get_contents('templates/login_form.html') . '&lt;h2&gt;Username or Password is incorrect&lt;/h2&gt;';
            }
        } else { // in case if we already logged (on refresh page):
            if (isset($_SESSION['member_name']) &amp;&amp; $_SESSION['member_name'] &amp;&amp; $_SESSION['member_pass']) {
                $aReplaces = array(
                    '{name}' =&gt; $_SESSION['member_name'],
                    '{status}' =&gt; $_SESSION['member_status'],
                    '{role}' =&gt; $_SESSION['member_role'],
                );
                return strtr(file_get_contents('templates/logout_form.html'), $aReplaces);
            }

            // otherwise - draw login form
            return file_get_contents('templates/login_form.html');
        }
    }

    // perform login
    function performLogin($sName, $sPass) {
        $this-&gt;performLogout();

        // make variables safe
        $sName = $GLOBALS['MySQL']-&gt;escape($sName);

        $aProfile = $GLOBALS['MySQL']-&gt;getRow(&quot;SELECT * FROM `cs_profiles` WHERE `name`='{$sName}'&quot;);
        // $sPassEn = $aProfile['password'];
        $sSalt = $aProfile['salt'];
        $sStatus = $aProfile['status'];
        $sRole = $aProfile['role'];

        $sPass = sha1(md5($sPass) . $sSalt);

        $_SESSION['member_name'] = $sName;
        $_SESSION['member_pass'] = $sPass;
        $_SESSION['member_status'] = $sStatus;
        $_SESSION['member_role'] = $sRole;
    }

    // perform logout
    function performLogout() {
        unset($_SESSION['member_name']);
        unset($_SESSION['member_pass']);
        unset($_SESSION['member_status']);
        unset($_SESSION['member_role']);
    }

    // check login
    function checkLogin($sName, $sPass, $isHash = true) {
        // make variables safe
        $sName = $GLOBALS['MySQL']-&gt;escape($sName);
        $sPass = $GLOBALS['MySQL']-&gt;escape($sPass);

        $aProfile = $GLOBALS['MySQL']-&gt;getRow(&quot;SELECT * FROM `cs_profiles` WHERE `name`='{$sName}'&quot;);
        $sPassEn = $aProfile['password'];

        if ($sName &amp;&amp; $sPass &amp;&amp; $sPassEn) {
            if (! $isHash) {
                $sSalt = $aProfile['salt'];
                $sPass = sha1(md5($sPass) . $sSalt);
            }
            return ($sPass == $sPassEn);
        }
        return false;
    }
}

$GLOBALS['CLogin'] = new CLogin();
</pre><p>I hope you still remember our <a
href="http://www.script-tutorials.com/creating-advance-level-login-system-with-logic-captcha/" target="_blank">previous article of advanced login system</a>. We will have similar system with using sha1 + md5 encryption. All profiles will kept in database.</p><h4>classes/CMySQL.php</h4><p>This is database service class. Available in package. Pay attention &#8211; database settings of our project is in this file.</p><hr
/><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - demo 218" href="http://www.script-tutorials.com/demos/218/index.php" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Powerful Chat System - package" href="http://www.script-tutorials.com/demos/218/source.zip" target="_blank" rel="nofollow">download in archive</a></strong></h5><hr
/><h3>Conclusion</h3><p>I will hope that our new series of articles of chat system creation will be useful and interesting for you. If you want to share your ideas, or you noticed any weakness &#8211; don&#8217;t hesitate to contact us. Good luck and welcome back!</p><div
class="shr-publisher-1360"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-3/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/226/thumb.png" alt="Powerful Chat System &#8211; Lesson 3" /> <br
/> Powerful Chat System &#8211; Lesson 3</a></li><li> <a
href="http://www.script-tutorials.com/powerful-chat-system-lesson-2/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/221/thumb.png" alt="Powerful Chat System &#8211; Lesson 2" /> <br
/> Powerful Chat System &#8211; Lesson 2</a></li><li> <a
href="http://www.script-tutorials.com/how-to-easily-make-a-php-chat-application/" rel="bookmark"> <img
src="/ssimages/no_image.gif" alt="How to Easily Make a PHP Chat Application" /> <br
/> How to Easily Make a PHP Chat Application</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/powerful-chat-system/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Creating photo album with jQuery Fotorama</title><link>http://www.script-tutorials.com/photo-album-with-jquery-fotorama/</link> <comments>http://www.script-tutorials.com/photo-album-with-jquery-fotorama/#comments</comments> <pubDate>Wed, 11 Jan 2012 12:44:06 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[HTML/CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Fotorama]]></category> <category><![CDATA[iphone]]></category> <category><![CDATA[photo album]]></category> <category><![CDATA[touch]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1353</guid> <description><![CDATA[Creating photo album with jQuery Fotorama Today I have prepared tutorial about using new impressive jQuery gallery &#8211; Fotorama. This is a nice looking javascript gallery with intuitive controls, and great browser compatibility. You can use this plugin at iPhones and any other mobile devices (you can slide photos with touch). Here are links to [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/creating-photo-album-with-galleriffic-jquery-plugin/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/156/thumb.png" alt="Creating a Photo Album with Galleriffic jQuery plugin" /> Creating a Photo Album with Galleriffic jQuery plugin</a></li><li> <a
href="http://www.script-tutorials.com/creating-photo-album-with-jquery-chop-slider/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/196/thumb.png" alt="Creating photo album with jQuery Chop Slider" /> Creating photo album with jQuery Chop Slider</a></li><li> <a
href="http://www.script-tutorials.com/how-to-create-photo-album-with-tn3/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/146/thumb.png" alt="How to Create a Fantastic Photo Album with TN3" /> How to Create a Fantastic Photo Album with TN3</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Creating photo album with jQuery Fotorama" alt="Creating photo album with jQuery Fotorama" src="http://www.script-tutorials.com/demos/216/thumb.png"></div><p><strong>Creating photo album with jQuery Fotorama</strong><br
/> <br
/>Today I have prepared tutorial about using new impressive jQuery gallery &#8211; Fotorama. This is a nice looking javascript gallery with intuitive controls, and great browser compatibility. You can use this plugin at iPhones and any other mobile devices (you can slide photos with touch).<br
/> <span
id="more-1353"></span></p><p>Here are links to demo and downloadable package:</p><h5 style="text-align: center;"><strong><a
title="Creating photo album with jQuery Fotorama - demo 216" href="http://www.script-tutorials.com/demos/216/index.html" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Creating photo album with jQuery Fotorama - package" href="http://www.script-tutorials.com/demos/216/source.zip" target="_blank">download in package</a></strong></h5><hr
/><p>Ok, lets download the example files and goto coding !</p><hr
/><h3>Step 1. HTML</h3><h4>index.html</h4><p>This is markup of our result page with Fotorama gallery. Here it is.</p><pre class="brush:html">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot; &gt;
    &lt;head&gt;
        &lt;meta charset=&quot;utf-8&quot; /&gt;
        &lt;title&gt;Creating photo album with jQuery Fotorama | Script Tutorials&lt;/title&gt;
        &lt;link href=&quot;css/layout.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
        &lt;link href=&quot;css/fotorama.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
        &lt;script src=&quot;http://code.jquery.com/jquery-latest.min.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;js/fotorama.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;js/main.js&quot;&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;header&gt;
            &lt;h2&gt;Creating photo album with jQuery Fotorama&lt;/h2&gt;
            &lt;a href=&quot;http://www.script-tutorials.com/photo-album-with-jquery-fotorama/&quot; class=&quot;stuts&quot;&gt;Back to original tutorial on &lt;span&gt;Script Tutorials&lt;/span&gt;&lt;/a&gt;
        &lt;/header&gt;
        &lt;div class=&quot;container&quot;&gt;

            &lt;div id=&quot;fotorama&quot;&gt;
                &lt;img src=&quot;images/pic1.jpg&quot; alt=&quot;photo #1&quot; /&gt;
                &lt;img src=&quot;images/pic2.jpg&quot; alt=&quot;photo #2&quot; /&gt;
                &lt;img src=&quot;images/pic3.jpg&quot; alt=&quot;photo #3&quot; /&gt;
                &lt;img src=&quot;images/pic4.jpg&quot; alt=&quot;photo #4&quot; /&gt;
                &lt;img src=&quot;images/pic5.jpg&quot; alt=&quot;photo #5&quot; /&gt;
                &lt;img src=&quot;images/pic6.jpg&quot; alt=&quot;photo #6&quot; /&gt;
                &lt;img src=&quot;images/pic7.jpg&quot; alt=&quot;photo #7&quot; /&gt;
                &lt;img src=&quot;images/pic8.jpg&quot; alt=&quot;photo #8&quot; /&gt;
                &lt;img src=&quot;images/pic9.jpg&quot; alt=&quot;photo #9&quot; /&gt;
                &lt;img src=&quot;images/pic10.jpg&quot; alt=&quot;photo #10&quot; /&gt;
                &lt;img src=&quot;images/pic11.jpg&quot; alt=&quot;photo #11&quot; /&gt;
                &lt;img src=&quot;images/pic12.jpg&quot; alt=&quot;photo #12&quot; /&gt;
            &lt;/div&gt;

        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre><p>Very easy &#8211; right?</p><h3>Step 2. CSS</h3><h4>css/layout.css and css/fotorama.css</h4><p>First stylesheet is page layout of our page. Second one is default stylesheet file of fotorama gallery. You can customize it (if need). Both files available in our package.</p><h3>Step 3. JS</h3><h4>js/fotorama.js</h4><p>This is main gallery javascript file. It uses jQuery, so we have to include both (fotorama.js and jquery) files. This file available in package.</p><h4>js/main.js</h4><pre class="brush:js">
jQuery(function(){
    $('#fotorama').fotorama({
        // width: 1000, // Width of container
        // height: 600, // Height of container
        startImg: 10, // Initial image
        transitionDuration: 400, // Duration of transition
        touchStyle: true, // Enable dragging
        // pseudoClick: true, // Slide between images by click (if touchStyle = true)
        // loop: false, // Loop for images (if touchStyle = false)
        // backgroundColor: null, // Custom background color
        margin: 10, // Margin between images
        // minPadding: 10, // Min padding
        // alwaysPadding: false, // Apply padding for images
        // preload: 3, // Amount of pre-loaded images from each end of the active image
        // resize: false, // Resize images
        // zoomToFit: true, // Zoom to fit
        // cropToFit: false, // Crop to fit
        // vertical: false, // Vertical thumbs
        // verticalThumbsRight: false, // Vertical thumbs at right
        // arrows: true, // Draw arrows
        arrowsColor: '#3399cc', // Arrows color
        // thumbs: true, // Draw thumbs
        // thumbsBackgroundColor: null, // Thumbs Background Color
        // thumbColor: null, // Thumb Color
        // thumbsPreview: true, // Thumb Preview
        thumbSize: 50, // Thumb size (height)
        // thumbMargin: 5, // Thumb margins
        thumbBorderWidth: 1, // Thumb border width
        // thumbBorderColor: null, // Thumb Border Color
        caption: true, // Display captions
        // html: null, // You can full html code of gallery here
        // onShowImg: null, // Custom function when we select image
        // shadows: true // Display shadows
    });
});
</pre><p>This is main initialization of fotorama gallery. Several styles was customized, another &#8211; no. I have added descriptions of all possible parameters of this gallery.</p><p><a
rel="nofollow" href="http://fotoramajs.com/">Here</a> you can find official documentation of this gallery.</p><h3>Step 4. Images</h3><p>All gallery images is in &#8216;images&#8217; folder.</p><hr
/><h5 style="text-align: center;"><strong><a
title="Creating photo album with jQuery Fotorama - demo 216" href="http://www.script-tutorials.com/demos/216/index.html" target="_blank" rel="nofollow">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Creating photo album with jQuery Fotorama - package" href="http://www.script-tutorials.com/demos/216/source.zip" target="_blank" rel="nofollow">download in package</a></strong></h5><hr
/><h3>Conclusion</h3><p>I hope that today we made new nice photo gallery. Good luck in your projects!</p><div
class="shr-publisher-1353"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/creating-photo-album-with-galleriffic-jquery-plugin/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/156/thumb.png" alt="Creating a Photo Album with Galleriffic jQuery plugin" /> <br
/> Creating a Photo Album with Galleriffic jQuery plugin</a></li><li> <a
href="http://www.script-tutorials.com/creating-photo-album-with-jquery-chop-slider/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/196/thumb.png" alt="Creating photo album with jQuery Chop Slider" /> <br
/> Creating photo album with jQuery Chop Slider</a></li><li> <a
href="http://www.script-tutorials.com/how-to-create-photo-album-with-tn3/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/146/thumb.png" alt="How to Create a Fantastic Photo Album with TN3" /> <br
/> How to Create a Fantastic Photo Album with TN3</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/photo-album-with-jquery-fotorama/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>10 fresh jQuery plugins (december 2011)</title><link>http://www.script-tutorials.com/10-fresh-jquery-plugins-december-2011/</link> <comments>http://www.script-tutorials.com/10-fresh-jquery-plugins-december-2011/#comments</comments> <pubDate>Thu, 29 Dec 2011 16:43:50 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[resources]]></category> <category><![CDATA[december]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[roundup]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1333</guid> <description><![CDATA[10 fresh jQuery plugins (december 2011) Before coming New Years holidays &#8211; I have decided to prepare last one collection of interesting jQuery plugins released over the last month. Here are different plugins for sharing content, scrollers / sliders, webcam plugin, time grid etc. 1. MASHA (Mark &#038; Share) MASHA (short for Mark &#038; Share) [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-november-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/195/thumb.png" alt="10 interesting jQuery plugins (november 2011)" /> 10 interesting jQuery plugins (november 2011)</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-of-october-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/175/thumb.png" alt="10 interesting jQuery plugins of October 2011" /> 10 interesting jQuery plugins of October 2011</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-august-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/131/thumb.png" alt="10 interesting jQuery plugins (august 2011)" /> 10 interesting jQuery plugins (august 2011)</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Ten fresh jQuery plugins (december 2011)" src="http://www.script-tutorials.com/demos/210/thumb.png"></div><p><strong>10 fresh jQuery plugins (december 2011)</strong><br
/> <br
/>Before coming New Years holidays &#8211; I have decided to prepare last one collection of interesting jQuery plugins released over the last month. Here are different plugins for sharing content, scrollers / sliders, webcam plugin, time grid etc.<br
/> <span
id="more-1333"></span></p><hr
/><h3><a
rel="nofollow" target="_blank" href="http://mashajs.com/index_eng.html">1. MASHA (Mark &#038; Share)</a></h3><p>MASHA (short for Mark &#038; Share) is a JavaScript utility allowing you to mark interesting parts of web page content and share it. Online demo you can find at same page.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img1.png" alt="MASHA (Mark &#038; Share)" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.jscraft.net/plugins/scroller.html">2. JScraft scroller</a></h3><p>By clicking on the picture &#8211; picture will stand in the center, rest photos &#8211; will shifted. You can use it at your promo site, site studio and in the portfolio. Online demo you can find <a
rel="nofollow" target="_blank" href="http://www.jscraft.net/demo/plugins/scroller/">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img2.jpg" alt="JScraft scroller" /></p><h3><a
rel="nofollow" target="_blank" href="http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-windows-like-interface-with-jquery-ui/">3. Windows-like Interface</a></h3><p>In this tutorial you can read about creating jQuery plugin to create a Windows-like dialogs. Online demo you can find <a
rel="nofollow" target="_blank" href="http://nettuts.s3.amazonaws.com/1099_jqui/demo/index.html">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img3.png" alt="Windows-like Interface" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.flowslider.com/">4. Flow Slider </a></h3><p>Flow Slider is lightweight jQuery plugin that lets you slide your HTML content through mouse interaction. Flow Slider works by hovering to the right or left side of the contents and converts unordered list into a slider. Online demo you can find at same page.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img4.jpg" alt="Flow Slider " /></p><h3><a
rel="nofollow" target="_blank" href="http://ricostacruz.com/jquery.transit/">5. jQuery Transit </a></h3><p>Super-smooth CSS3 transformations and transitions for jQuery. Online demo you can find at same page. jQuery Transit it a plugin for implementing CSS transitions and transforms, it has the same syntax as .animate, supports almost all methods and supports jQuery callbacks, chaining, auto-browser-prefixes and more.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img5.png" alt="jQuery Transit " /></p><h3><a
rel="nofollow" target="_blank" href="http://designwithpc.com/Plugins/Hovercard">6. Hovercard</a></h3><p>Hovercard is a jQuery plugin allows you to easily display related information with the hovered label, link, or any html element of your choice. Hovercard can be handy while displaying micro info such as person bio, book author and price, loading related information with Ajax, editing in place etc. Online demo you can find at same page.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img6.jpg" alt="Hovercard" /></p><h3><a
rel="nofollow" target="_blank" href="http://kiro.me/textualizer/">7. textualizer</a></h3><p>Textualizer is lightweight jQuery Plugin that helps you to create beautiful effects on text. Textualizer allows you to transition through blurb of text, when transitioning to a new blurb, any character that is common to the next blurb is kept on the screen and moved to its new position. Online demo you can find at same page.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img7.jpg" alt="textualizer" /></p><h3><a
rel="nofollow" target="_blank" href="http://responsejs.com/">8. Response JS</a></h3><p>Response JS is a lightweight jQuery plugin that gives web designers tools for building performance-optimized, mobile-first responsive websites. It provides semantic ways to dynamically swap code blocks based on breakpoints and serve media progressively via HTML5 data attributes. Its object methods give developers hooks for triggering responsive actions and booleans for testing responsive properties.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img8.jpg" alt="Response JS" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.xarg.org/project/jquery-webcam-plugin/">9. jQuery webcam plugin</a></h3><p>This plugin provides three different modes to access a webcam through a small API directly with JavaScript &#8211; or more precisely jQuery. Thus, it is possible to bring the image on a Canvas (callback mode), to store the image on the server (save mode) and to stream the live image of the Flash element on a Canvas (stream mode).<br
/> <img
src="http://www.script-tutorials.com/demos/210/img9.jpg" alt="jQuery webcam plugin" /></p><h3><a
rel="nofollow" target="_blank" href="http://timeglider.com/jquery/">10. Timeglider</a></h3><p>Timeglider JS is a zooming, panning data-driven timeline widget written in Javascript— great for history projects, project planning, and more. Online demo you can find same page.<br
/> <img
src="http://www.script-tutorials.com/demos/210/img10.jpg" alt="Timeglider" /></p><hr
/><h3>Conclusion</h3><p>Hope that our new collection of new jQuery plugins was interested for you. Good luck!</p><div
class="shr-publisher-1333"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-november-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/195/thumb.png" alt="10 interesting jQuery plugins (november 2011)" /> <br
/> 10 interesting jQuery plugins (november 2011)</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-of-october-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/175/thumb.png" alt="10 interesting jQuery plugins of October 2011" /> <br
/> 10 interesting jQuery plugins of October 2011</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-august-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/131/thumb.png" alt="10 interesting jQuery plugins (august 2011)" /> <br
/> 10 interesting jQuery plugins (august 2011)</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/10-fresh-jquery-plugins-december-2011/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>10 interesting jQuery plugins (november 2011)</title><link>http://www.script-tutorials.com/10-interesting-jquery-plugins-november-2011/</link> <comments>http://www.script-tutorials.com/10-interesting-jquery-plugins-november-2011/#comments</comments> <pubDate>Mon, 05 Dec 2011 14:44:29 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[resources]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[roundup]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1274</guid> <description><![CDATA[10 interesting jQuery plugins (november 2011) Today I have collected with own hands new most interesting jQuery plugins that have released over the last month. Here are different plugins like face detector, sliders, plugins for forms, even full UI widgets pack etc. 1. Face detection A jQuery plugin which detects faces in pictures and returns [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-of-october-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/175/thumb.png" alt="10 interesting jQuery plugins of October 2011" /> 10 interesting jQuery plugins of October 2011</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-september-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/151/thumb.png" alt="10 interesting jQuery plugins (september 2011)" /> 10 interesting jQuery plugins (september 2011)</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-august-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/131/thumb.png" alt="10 interesting jQuery plugins (august 2011)" /> 10 interesting jQuery plugins (august 2011)</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Ten fresh interesting jQuery plugins (november 2011)" src="http://www.script-tutorials.com/demos/195/thumb.png"></div><p><strong>10 interesting jQuery plugins (november 2011)</strong><br
/> <br
/>Today I have collected with own hands new most interesting jQuery plugins that have released over the last month. Here are different plugins like face detector, sliders, plugins for forms, even full UI widgets pack etc.<br
/> <span
id="more-1274"></span></p><hr
/><h3><a
rel="nofollow" target="_blank" href="https://github.com/jaysalvat/jquery.facedetection">1. Face detection</a></h3><p>A jQuery plugin which detects faces in pictures and returns theirs coords. This plugin uses an algorithm by Liu Liu. Online demo you can find <a
rel="nofollow" target="_blank" href="http://facedetection.jaysalvat.com/">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img1.jpg" alt="Face detection" /></p><h3><a
rel="nofollow" target="_blank" href="http://isotope.metafizzy.co/index.html">2. Isotope</a></h3><p>Isotope is an exquisite jQuery plugin for magical layouts. You can find demo at same page.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img2.jpg" alt="Isotope" /></p><h3><a
rel="nofollow" target="_blank" href="http://christianv.github.com/jquery-lifestream/">3. jQuery Lifestream</a></h3><p>This plugin can help you to create own activity feed (SPY) of your website. Online demo you can find <a
rel="nofollow" target="_blank" href="http://christianv.github.com/jquery-lifestream/example.html">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img3.jpg" alt="jQuery Lifestream" /></p><h3><a
rel="nofollow" target="_blank" href="https://github.com/christophercliff/sausage">4. Sausage</a></h3><p>This is jQuery UI widget for contextual pagination for your pages. Pagination can be really user friendly! Online demo you can find <a
rel="nofollow" target="_blank" href="http://christophercliff.github.com/sausage/examples/couchdb.html">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img4.jpg" alt="sausage" /></p><h3><a
rel="nofollow" target="_blank" href="http://buildinternet.com/project/supersized/">5. Supersized</a></h3><p>Supersized is a fullscreen background slideshow built using the jQuery library. Online demo you can find <a
rel="nofollow" target="_blank" href="http://buildinternet.com/project/supersized/slideshow/3.2/demo.html">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img5.jpg" alt="Supersized" /></p><h3><a
rel="nofollow" target="_blank" href="https://github.com/davatron5000/FitVids.js">6. FitVids.js</a></h3><p>A lightweight, easy-to-use jQuery plugin for fluid width video embeds. Online demo you can find <a
rel="nofollow" target="_blank" href="http://fitvidsjs.com/">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img6.jpg" alt="FitVids.js" /></p><h3><a
rel="nofollow" target="_blank" href="https://github.com/harvesthq/chosen/">7. Chosen</a></h3><p>Chosen is a library for making long, unwieldy select boxes (combo boxes) more user friendly. Online demo you can find <a
rel="nofollow" target="_blank" href="http://harvesthq.github.com/chosen/">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img7.jpg" alt="Chosen" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.jqwidgets.com/">8. jQuery Widgets</a></h3><p>jQWidgets gives us something new and special. It’s a new and unique library for jQuery UI development and unlike others it makes our Apps and Websites look beautiful on desktops, touch devices and mobile phones. Online demo you can find <a
rel="nofollow" target="_blank" href="http://www.jqwidgets.com/jquery-widgets-demo/">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img8.jpg" alt="jQuery Widgets" /></p><h3><a
rel="nofollow" target="_blank" href="https://github.com/nathansmith/formalize">9. Formalize</a></h3><p>Teach your forms some manners &#8211; this plugin allow us to enhance our forms. Online demo you can find <a
rel="nofollow" target="_blank" href="http://formalize.me/demo.html">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img9.jpg" alt="Formalize" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.script-tutorials.com/cool-background-image-sliding-effect-with-jquery/">10. Background Image Slider</a></h3><p>And finally, our own original image slider here. Online demo you can find <a
rel="nofollow" target="_blank" href="http://www.script-tutorials.com/demos/185/index.html">here</a>.<br
/> <img
src="http://www.script-tutorials.com/demos/195/img10.jpg" alt="Background Image Slider" /></p><hr
/><h3>Conclusion</h3><p>Hope that our new collection of new jQuery plugins was interested for you. Good luck!</p><div
class="shr-publisher-1274"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-of-october-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/175/thumb.png" alt="10 interesting jQuery plugins of October 2011" /> <br
/> 10 interesting jQuery plugins of October 2011</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-september-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/151/thumb.png" alt="10 interesting jQuery plugins (september 2011)" /> <br
/> 10 interesting jQuery plugins (september 2011)</a></li><li> <a
href="http://www.script-tutorials.com/10-interesting-jquery-plugins-august-2011/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/131/thumb.png" alt="10 interesting jQuery plugins (august 2011)" /> <br
/> 10 interesting jQuery plugins (august 2011)</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/10-interesting-jquery-plugins-november-2011/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>10 fresh jQuery Tutorials</title><link>http://www.script-tutorials.com/10-fresh-jquery-tutorials/</link> <comments>http://www.script-tutorials.com/10-fresh-jquery-tutorials/#comments</comments> <pubDate>Tue, 22 Nov 2011 18:29:02 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[resources]]></category> <category><![CDATA[fresh]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[scripts]]></category> <category><![CDATA[tutorials]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1236</guid> <description><![CDATA[10 fresh jQuery tutorials Today I decide to select some fresh great and interesting jQuery tutorials for you. These tutorials and for beginners and advanced developers. The most simple tutorials will about creating weather plugin, draggable captcha, the more difficult will about creating new galleries. Hope you find it useful for you! 1. Draggable Image [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-fresh-android-tutorials/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/192/thumb.png" alt="10 Fresh Android tutorials" /> 10 Fresh Android tutorials</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-html5-tutorials/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/182/thumb.png" alt="10 Fresh HTML5 Tutorials" /> 10 Fresh HTML5 Tutorials</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-popular-jquery-plugins/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/80/thumb.png" alt="10 Fresh and Popular jQuery plugins" /> 10 Fresh and Popular jQuery plugins</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Ten fresh jQuery tutorials" alt="Ten fresh jQuery tutorials" src="http://www.script-tutorials.com/demos/187/thumb.png"></div><p><strong>10 fresh jQuery tutorials</strong><br
/> <br
/>Today I decide to select some fresh great and interesting jQuery tutorials for you. These tutorials and for beginners and advanced developers. The most simple tutorials will about creating weather plugin, draggable captcha, the more difficult will about creating new galleries. Hope you find it useful for you!<br
/> <span
id="more-1236"></span></p><hr
/><h3><a
rel="nofollow" target="_blank" href="http://tympanus.net/codrops/2011/10/07/draggable-image-boxes-grid/">1. Draggable Image Boxes Grid</a></h3><p>This is full screen draggable grid of images. Once clicked, the thumbnail will expand to the full size image and the menu item box will expand to a fullscreen content area.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img1.jpg" alt="Draggable Image Boxes Grid" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.queness.com/post/6480/create-an-attractive-before-and-after-photo-effect-with-jquery">2. Before and After</a></h3><p>Create an Attractive Before and After Photo Effect with jQuery.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img2.jpg" alt="Before and After" /></p><h3><a
rel="nofollow" target="_blank" href="http://net.tutsplus.com/tutorials/javascript-ajax/how-to-build-an-rss-reader-with-jquery-mobile-2/">3. How to Build an RSS Reader</a></h3><p>In this tutials authors tell us about creating easy rss reader using jQuery mobile.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img3.jpg" alt="How to Build an RSS Reader" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.onextrapixel.com/2011/08/22/adding-weather-to-your-site-with-jquery-and-yql/">4. Adding Weather to Your Site with jQuery and YQL</a></h3><p>This tutorial guide us through the process of creating this weather script from start to finish.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img4.jpg" alt="Weather to Your Site" /></p><h3><a
rel="nofollow" target="_blank" href="http://tutorialzine.com/2011/09/jquery-pointpoint-plugin/">5. jQuery PointPoint</a></h3><p>This plugin will help you draw users attention to a specific part of the page, in the form of a small arrow that is displayed next to their mouse cursor.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img5.jpg" alt="jQuery PointPoint" /></p><h3><a
rel="nofollow" target="_blank" href="http://sitehelp.com.au/jquery-fancy-draggable-captcha/">6. jQuery fancy Draggable Captcha</a></h3><p>Clean and small tutorial with demonstration of prepared jquery draggable captcha.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img6.jpg" alt="jQuery fancy Draggable Captcha" /></p><h3><a
rel="nofollow" target="_blank" href="http://tympanus.net/codrops/2011/11/22/hover-and-click-trigger-circular-elements/">7. Hover and Click Trigger for Circular Elements</a></h3><p>Another one interesting tutorials from tympanus.net. Event handling for circular shape objects.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img7.jpg" alt="Hover and Click Trigger for Circular Elements" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.learningjquery.com./2011/09/using-jquerys-data-apis">8. Using jQuery’s Data APIs</a></h3><p>This info-tutorial will useful for beginners.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img8.jpg" alt="Using jQuery’s Data APIs" /></p><h3><a
rel="nofollow" target="_blank" href="http://designshack.net/articles/javascript/developing-a-jquery-private-messaging-modal-box/">9. Developing a jQuery Private Messaging Modal Box</a></h3><p>Nice and small solution for private messaging. This is perfect to implement on a user profile page or author&#8217;s page in a blog.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img9.jpg" alt="Developing a jQuery Private Messaging Modal Box" /></p><h3><a
rel="nofollow" target="_blank" href="http://www.script-tutorials.com/cool-background-image-sliding-effect-with-jquery/">10. Cool Background Image Sliding effect with jQuery</a></h3><p>And finally &#8211; our own fresh jQuery tutorial about making nice image sliding effect.<br
/> <img
src="http://www.script-tutorials.com/demos/187/img10.jpg" alt="Cool Background Image Sliding effect with jQuery" /></p><div
class="shr-publisher-1236"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/10-fresh-android-tutorials/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/192/thumb.png" alt="10 Fresh Android tutorials" /> <br
/> 10 Fresh Android tutorials</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-html5-tutorials/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/182/thumb.png" alt="10 Fresh HTML5 Tutorials" /> <br
/> 10 Fresh HTML5 Tutorials</a></li><li> <a
href="http://www.script-tutorials.com/10-fresh-popular-jquery-plugins/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/80/thumb.png" alt="10 Fresh and Popular jQuery plugins" /> <br
/> 10 Fresh and Popular jQuery plugins</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/10-fresh-jquery-tutorials/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Cool Background Image Sliding effect with jQuery</title><link>http://www.script-tutorials.com/cool-background-image-sliding-effect-with-jquery/</link> <comments>http://www.script-tutorials.com/cool-background-image-sliding-effect-with-jquery/#comments</comments> <pubDate>Fri, 18 Nov 2011 17:55:19 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[HTML/CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[animation]]></category> <category><![CDATA[background]]></category> <category><![CDATA[effect]]></category> <category><![CDATA[sliding]]></category><guid
isPermaLink="false">http://www.script-tutorials.com/?p=1222</guid> <description><![CDATA[Cool Background Image Sliding effect with jQuery Today I am going to show you how to create sliding image cell effect. This is will something like small photo gallery. I prepared 3 demos for you with different effects. Please pay attention that our demo will work in browsers that support used CSS3 properties. Live Demo [...]<div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/cross-browser-image-shaking-effect-using-javascript/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/71/thumb.png" alt="Cross-browser Supported Image Skew effect using Javascript" /> Cross-browser Supported Image Skew effect using Javascript</a></li><li> <a
href="http://www.script-tutorials.com/jquery-css-tutorial-zooming-image/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/3/images/ajax_small.gif" alt="Jquery CSS Tutorial on Zooming Image" /> Jquery CSS Tutorial on Zooming Image</a></li><li> <a
href="http://www.script-tutorials.com/creating-css3-drop-sliding-list-menu-6/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/113/thumb.png" alt="Creating CSS3 Drop sliding list Menu #6" /> Creating CSS3 Drop sliding list Menu #6</a></li></ol></div>]]></description> <content:encoded><![CDATA[<div
class="thumb"><img
width="128" height="128" class="aligncenter" title="Cool Background Image Sliding effect with jQuery" alt="Cool Background Image Sliding effect with jQuery" src="http://www.script-tutorials.com/demos/185/thumb.png"></div><p><strong>Cool Background Image Sliding effect with jQuery</strong><br
/> <br
/>Today I am going to show you how to create sliding image cell effect. This is will something like small photo gallery. I prepared 3 demos for you with different effects. Please pay attention that our demo will work in browsers that support used CSS3 properties.<br
/> <span
id="more-1222"></span></p><h5 style="text-align: center;"><strong><a
title="Cool Background Image Sliding effect with jQuery - demo 185" href="http://www.script-tutorials.com/demos/185/index.html" target="_blank">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Cool Background Image Sliding effect with jQuery - package" href="http://www.script-tutorials.com/demos/185/source.zip" target="_blank">download result</a></strong></h5><hr
/><p>Ok, download the example files and lets start coding !</p><hr
/><h3>Step 1. HTML</h3><p>Here are full html code of our result. For our demonstration I use 5 photos &#8211; same amount of &#8216;navigation&#8217; elements you can see here too.</p><h4>index.html</h4><pre class="brush:html">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot; &gt;
    &lt;head&gt;
        &lt;meta charset=&quot;utf-8&quot; /&gt;
        &lt;title&gt;Cool Background Image Sliding effect with jQuery | Script Tutorials&lt;/title&gt;
        &lt;link href=&quot;css/main.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;

        &lt;!--[if lt IE 9]&gt;
          &lt;script src=&quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
        &lt;![endif]--&gt;
        &lt;script src=&quot;http://code.jquery.com/jquery-latest.min.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;js/main.js&quot;&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div class=&quot;container&quot; id=&quot;container&quot;&gt;
            &lt;ul class=&quot;nav&quot;&gt;
                &lt;li id=&quot;m1&quot;&gt;Pic 1&lt;/li&gt;
                &lt;li id=&quot;m2&quot;&gt;Pic 2&lt;/li&gt;
                &lt;li id=&quot;m3&quot;&gt;Pic 3&lt;/li&gt;
                &lt;li id=&quot;m4&quot;&gt;Pic 4&lt;/li&gt;
                &lt;li id=&quot;m5&quot;&gt;Pic 5&lt;/li&gt;
            &lt;/ul&gt;

            &lt;ul class=&quot;grid&quot;&gt;
                &lt;li id=&quot;g1&quot;&gt;
                    &lt;div class=&quot;d1&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d2&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d3&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d4&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d5&quot;&gt;&lt;/div&gt;
                &lt;/li&gt;
                &lt;li id=&quot;g2&quot;&gt;
                    &lt;div class=&quot;d1&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d2&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d3&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d4&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d5&quot;&gt;&lt;/div&gt;
                &lt;/li&gt;
                &lt;li id=&quot;g3&quot;&gt;
                    &lt;div class=&quot;d1&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d2&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d3&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d4&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d5&quot;&gt;&lt;/div&gt;
                &lt;/li&gt;
                &lt;li id=&quot;g4&quot;&gt;
                    &lt;div class=&quot;d1&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d2&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d3&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d4&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d5&quot;&gt;&lt;/div&gt;
                &lt;/li&gt;
                &lt;li id=&quot;g5&quot;&gt;
                    &lt;div class=&quot;d1&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d2&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d3&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d4&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d5&quot;&gt;&lt;/div&gt;
                &lt;/li&gt;
                &lt;li id=&quot;g6&quot;&gt;
                    &lt;div class=&quot;d1&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d2&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d3&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d4&quot;&gt;&lt;/div&gt;
                    &lt;div class=&quot;d5&quot;&gt;&lt;/div&gt;
                &lt;/li&gt;
            &lt;/ul&gt;
            &lt;ul class=&quot;demos&quot;&gt;
                &lt;li&gt;&lt;a href=&quot;index.html&quot;&gt;Demo 1&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;index2.html&quot;&gt;Demo 2&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;index3.html&quot;&gt;Demo 3&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
        &lt;footer&gt;
            &lt;h2&gt;Cool Background Image Sliding effect with jQuery&lt;/h2&gt;
            &lt;a href=&quot;http://www.script-tutorials.com/cool-background-image-sliding-effect-with-jquery/&quot; class=&quot;stuts&quot;&gt;Back to original tutorial on &lt;span&gt;Script Tutorials&lt;/span&gt;&lt;/a&gt;
        &lt;/footer&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre><h3>Step 2. CSS</h3><p>Now &#8211; our CSS styles. I will omit unnecessary styles of page layout, but will show you most important</p><h4>css/main.css</h4><pre class="brush:css">
.nav {
    background-color:#DDD;
    list-style:none outside none;
    overflow:hidden;
    padding:5px 140px;
}
.nav li {
    border-radius:10px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;

    border:2px outset #000000;
    color:#000;
    cursor:pointer;
    float:left;
    font-size:18px;
    font-weight:bold;
    margin-right:5px;
    padding:10px;
}

.demos {
    background-color:#DDD;
    list-style:none outside none;
    overflow:hidden;
    padding:5px 165px;
}
.demos li {
    border-radius:10px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;

    border:2px outset #000000;
    color:#000;
    float:left;
    font-size:18px;
    font-weight:bold;
    margin-right:5px;
    padding:10px;
}
.demos li a {
    color:#000;
    cursor:pointer;
    display:block;
    font-size:20px;
    font-weight:bold;
    height:30px;
    line-height:30px;
    text-decoration:none;
}

.grid {
    background-color:#DDD;
    list-style:none outside none;
    width:100%;
}
.grid li {
    border:1px solid #777777;
    float:left;
    height:240px;
    width:211px;

    transition:all 0.5s linear;
    -moz-transition:all 0.5s linear;
    -o-transition:all 0.5s linear;
    -webkit-transition:all 0.5s linear;
}
.grid li div {
    transition:all 0.5s ease-in-out;
    -moz-transition:all 0.5s ease-in-out;
    -o-transition:all 0.5s ease-in-out;
    -webkit-transition:all 0.5s ease-in-out;

    float:left;
}
.grid li .d1 {
    background:transparent url(../images/grid1.jpg) no-repeat top left;
    height:100%;
    width:211px;
}
.grid li .d2 {
    background:transparent url(../images/grid2.jpg) no-repeat top left;
    height:100%;
    width:0;
}
.grid li .d3 {
    background:transparent url(../images/grid3.jpg) no-repeat top left;
    height:100%;
    width:0;
}
.grid li .d4 {
    background:transparent url(../images/grid4.jpg) no-repeat top left;
    height:100%;
    width:0;
}
.grid li .d5 {
    background:transparent url(../images/grid5.jpg) no-repeat top left;
    height:100%;
    width:0;
}
.grid li#g2 div {
    background-position:-211px 0;
}
.grid li#g3 div {
    background-position:-422px 0;
}
.grid li#g4 div {
    background-position:0 -240px;
}
.grid li#g5 div {
    background-position:-211px -240px;
}
.grid li#g6 div {
    background-position:-422px -240px;
}
</pre><p>As you can see &#8211; each grid cell element (LI) have some defined background, but with own background positions. And, I will use jQuery &#8216;animate&#8217; to shift these positions when we will switch our images (through navigation)</p><h3>Step 3. jQuery</h3><h4>js/main.js</h4><pre class="brush:js">
$(function(){
    $(&quot;.nav li&quot;).hover(
      function () {
        $('.grid li div').stop().animate({width:&quot;0&quot;},0);

        var ind = $(&quot;.nav li&quot;).index(this);
        $($('.grid li#g1 div')[ind]).stop().animate({width:&quot;211px&quot;},0);
        $($('.grid li#g2 div')[ind]).stop().animate({width:&quot;211px&quot;},50);
        $($('.grid li#g3 div')[ind]).stop().animate({width:&quot;211px&quot;},100);
        $($('.grid li#g4 div')[ind]).stop().animate({width:&quot;211px&quot;},150);
        $($('.grid li#g5 div')[ind]).stop().animate({width:&quot;211px&quot;},200);
        $($('.grid li#g6 div')[ind]).stop().animate({width:&quot;211px&quot;},250);
      }
    );
});
</pre><p>As you can see &#8211; all very easy.</p><hr
/><h5 style="text-align: center;"><strong><a
title="Cool Background Image Sliding effect with jQuery - demo 185" href="http://www.script-tutorials.com/demos/185/index.html" target="_blank" rel="nofollow">Live Demo</a></strong></h5><h5 style="text-align: center;"><strong><a
title="Cool Background Image Sliding effect with jQuery - package" href="http://www.script-tutorials.com/demos/185/source.zip" target="_blank" rel="nofollow">download result</a></strong></h5><hr
/><h3>Conclusion</h3><p>All another demos very similar, only few changes in styles and javascript code. You are welcome to play with our demos. Good luck!</p><div
class="shr-publisher-1222"></div><div
id="main-related"><h4>Related Stuff You Will Love!</h4><ol
class="related-posts"><li> <a
href="http://www.script-tutorials.com/cross-browser-image-shaking-effect-using-javascript/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/71/thumb.png" alt="Cross-browser Supported Image Skew effect using Javascript" /> <br
/> Cross-browser Supported Image Skew effect using Javascript</a></li><li> <a
href="http://www.script-tutorials.com/jquery-css-tutorial-zooming-image/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/3/images/ajax_small.gif" alt="Jquery CSS Tutorial on Zooming Image" /> <br
/> Jquery CSS Tutorial on Zooming Image</a></li><li> <a
href="http://www.script-tutorials.com/creating-css3-drop-sliding-list-menu-6/" rel="bookmark"> <img
src="http://www.script-tutorials.com/demos/113/thumb.png" alt="Creating CSS3 Drop sliding list Menu #6" /> <br
/> Creating CSS3 Drop sliding list Menu #6</a></li></ol></div>]]></content:encoded> <wfw:commentRss>http://www.script-tutorials.com/cool-background-image-sliding-effect-with-jquery/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: basic (User agent is rejected)
Database Caching using disk: basic

Served from: www.script-tutorials.com @ 2012-02-04 21:36:43 -->
