Ajax Updates

Ajax Updates


Page Peel with Jquery Plugin

Posted: 15 Sep 2009 10:23 AM PDT

A jquery plugin to implement a page peel effect to place ads on your site.

If you haven’t seen it by now, check out the upper right corner of this page, or check out the new page peel in the bottom left of this box!

Now, the one contained inside of the box has its limitations. You have to have enough room to display the full page out (this one’s set up as 500×500). Also, I’ve set the bottom padding of this box to 105px so I don’t cover any content. You could also indent the content 105px or just cover your content. Whatever floats your boat.

I guess I should show you a bit of code on how to accomplish this… here it goes.

Adding to Your Website

To add this you’ll need jQuery and jQuery.pagePeel.js, then add the following to the head of your document:

 Javascript |  copy code |? 
01
<script type="text/javascript" src="js/jquery.js"></script> 
02
<script type="text/javascript" src="js/jQuery.pagePeel.js"></script> 
03
 
04
<script type="text/javascript"> 
05
 
06
$().ready(function(){ 
07
$('pagePeel').pagePeel({}); } 
08
 
09
</script> 
10
 
11
<body> 
12
 
13
<div id="pagePeel"> </div> 
14
</body>

The area in bold is the DOM element you want place the page peel inside of. If you want to add it to the body, place it right under the opening '' tag. If you want it added inside a div, place it right after the opening '
' tag. Be sure that div's position is set to relative in you CSS.

Options

options, options, options... That's the main thing I think about when building plugins, and this one is filled with them. They go inside the open/close brackets The ones displayed are the default options.

SET WIDTH / HEIGHT OF SMALL AD
smallWidth: 120
smallHeight: 120
smallBG: 'pp-src/smallBG.png' // if you are not using flash, this is where your small ad image is located

SET WIDTH / HEIGHT OF INTRO
introWidth: 300
introHeight:300

SET WIDTH / HEIGHT OF BIG AD (SAME AS .SWF)
bigWidth: 500
bigHeight: 500
bigBG: 'pp-src/bigBG.png' // if you are not using flash, this is where your large ad image is located
bigAd: 'pp-src/bigAd.jpg' // if you are using flash, this is where your ad image is located
bigSWF: 'pp-src/page-peel-big.swf' // if your flash file is in a different directory

ADD LINK AND TARGET OPTIONS
adLink: 'blank' // this is where you insert a URL (i.e. http://www.smple.com) || if left 'blank' no link will be applied
adLinkTarget: '_blank' // this is where you specify your target (i.e. '_parent' or '_blank')

SET POSITION OF YOUR AD
hPosition: 'right' // can use 'left' or 'right'
vPosition: 'top' // can use 'top' or 'bottom'

CHOOSE WHETHER TO USE FLASH OR NOT
flash: true

note: Only upper-right source .fla's are included for both with or without an intro. There is also a lower-left for demonstration purposes. Feel free to edit the files to suite your needs, but remember to change the file path if you change the file name.
WHETHER TO USE INTRO ANIMATION OR NOT AND WHAT FILE TO USE
introAnim: false
bigSWFIntro: 'pp-src/page-peel-big-intro.swf' // this is the default file location for the intro animation file

note: The intro option is currently set up to only work in the upper-right hand corner, however can be changed if you edit the source .fla.



Demo: http://www.smple.com/pagePeel
Download: http://www.smple.com/pagePeel/pagePeel.zip
Source: http://smple.com/2008/12/15/jquery-plugin-page-peel/
tafbutton blue16 Page Peel with Jquery Plugin

Related Listings:

  1. jMP3 – Jquery Mp3 Plugin jMP3 (javaScript MP3 player) is an easy way make...
  2. Ajax Fancy Captcha – jQuery Plugin Ajax Fancy Captcha is a jQuery plugin that helps you...
  3. Ajax Script – Scrolling Pages in Same Page This script loads pages / content from the server and...

jQuery Flick

Posted: 15 Sep 2009 09:53 AM PDT

This plugin adds Apple iPod/iPhone (firmware 2.0+) flick/scroll functionality to jQuery. Use built in Touch methods including ontouchstart, ontouchend and ontouchmove.

Includes rubber banding if the user scrolls past the top/bottom of the scrollable region. There is also an internal division ontouchstart to place over any clickable elements. This prevents items that are in the scrollable region from being clicked while you are in mid scroll.





Demo: http://www.manifestinteractive.com/iphone/flick/
Download: http://plugins.jquery.com/files/jquery.flick.js.txt
Source: http://plugins.jquery.com/project/flick
tafbutton blue16 jQuery Flick

Related Listings:

  1. iPhone Interface in Javascript This script can generate and embed Iphone like interface on...
  2. 10 incredible JQuery navigation menus JQuery is a lightweight, cross-browser compliant, and extremely powerful Javascript...
  3. jQuery Slider Gallery Michiel Kenis requested a tutorial explaining how to create a...

Agile Carousel v2.0

Posted: 15 Sep 2009 09:27 AM PDT

Agile Carousel is a JQuery plugin that lets you create a carousel with flexible settings.

 Javascript |  copy code |? 
01
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
02
<script> 
03
$('#slide_holder').agile_carousel({ 
04
	alt_attributes: "Highly Customizable,JQuery UI Transition Types & Effects,Automated Setup", 
05
	continue_timer_after_click: "no", 
06
	custom_data: "custom_data/custom_data_agile_carousel.php", 
07
	first_slide_is_intro: "yes", 
08
	first_last_buttons: "yes", 
09
	hover_next_prev_buttons: "yes", 
10
	intro_timer_length: "5000", 
11
	intro_transtion: "fade", 
12
	next_prev_buttons: "yes", 
13
	php_doc_location: "http://www.agilecarousel.com/make_slides.php", 
14
	pause_button: "yes", 
15
	remove_content: "no", 
16
	slide_buttons: "yes", 
17
	//slide_captions: "JQuery Carousel Plugin|Agile Slide Types|JQuery UI Effects Available|Agile Settings|Carousel That's Built to Order", // not used. Usind "custom_data" instead 
18
	//slide_directory: "agile_carousel_home_slides", 
19
	slide_doctype: "xhtml", 
20
	//slide_links: ",,http://agilecarousel.com,http://agilecarousel.com,http://agilecarousel.com", // not used. Using "custom data" instead 
21
	slide_number_display: "yes", 
22
	stop_rotate_on_hover: "yes", 
23
	target_attributes: "_self,_blank,_self", 
24
	timer_length: "5000", 
25
	transition_duration: 2000, 
26
	transition_easing: "swing", 
27
	transition_type: "fade", 
28
	water_mark: "yes" 
29
}); 
30
 
31
// external controls example 
32
$('#next_o').click(function(){ 
33
$.fn.agile_carousel.next(); 
34
}); 
35
$('#prev_o').click(function(){ 
36
$.fn.agile_carousel.prev(); 
37
}); 
38
$('#first_o').click(function(){ 
39
$.fn.agile_carousel.first(); 
40
}); 
41
$('#last_o').click(function(){ 
42
$.fn.agile_carousel.last(); 
43
}); 
44
$('#pause_play').click(function(){ 
45
$.fn.agile_carousel.pause_play(); 
46
}); 
47
$('#goto_3').click(function(){ 
48
$.fn.agile_carousel.go_to(3); 
49
}); 
50
 
51
</script> 
52
Example of "custom_data" PHP file. This allows you to draw carousel content from a custom source, rather than specifying a directory and other plugin settings like slide links, target attributes, alt attributes and captions.
 PHP |  copy code |? 
01
< ?php 
02
	$custom_data_arr = array( 
03
	'custom_slide_files'       => "http://www.agilecarousel.com/agile_carousel_slides_w_intro/00_agile_intro.swf,http://www.agilecarousel.com/agile_carousel_slides_w_intro/01_slide.jpg,http://www.agilecarousel.com/agile_carousel_slides_w_intro/02_slide.jpg,http://www.agilecarousel.com/agile_carousel_slides_w_intro/03_slide.jpg", 
04
	'custom_slide_links'       => "NA,http://www.agile_carousel.com,http://www.agile_carousel.com,http://www.agile_carousel.com", 
05
	'custom_target_attributes' => "NA,_self,_blank,_self", 
06
	'custom_alt_attributes'    => "NA,Slide 1,Slide 2,Slide 3", 
07
	'custom_slide_captions'    => "Customize with a wide assortment of settings|Use JQuery UI Effects &amp; Easing|Automated Setup" 
08
	); 
09
?> 
10



Demo: http://www.agilecarousel.com/examples/full_example
Download: http://plugins.jquery.com/files/jquery.agile_carousel-beta.2.0.zip
Source: http://plugins.jquery.com/node/4033
tafbutton blue16 Agile Carousel v2.0

Related Listings:

  1. Display anything in a Carousel Window Carousel are great to display a large set of data...
  2. Images Carousel.us Moving Script Ajax Images Carousel.us is a Javascript and AJAX 3D carousel...
  3. 3D Carousel Slideshow Carousel Slideshow is a fabulous DHTML script for the showcasing...

Milkbox using Mootools

Posted: 14 Sep 2009 08:54 PM PDT

As long as I’ll have the time to do it, I’ll try to help anyone who ask for some help with Milkbox implementation or for little customizations, but I’ll definitely favour people that make a donation (see the bottom of this page).

Main features

* Swf support. You can add swf links to your galleries as well as images.
Use the rev attribute to tell width and height of the swf file.
* AutoSize and maxHeight options. AutoSize is enabled by default; if needed, it makes photos smaller, so they’ll fit the browser window. If you want them not to be higher then a certain height, just set the maxHeight option.
* AutoPlay and autoPlayDelay options. You can set them globally or on a per-gallery basis, as well as in JavaScript calls.
* XML galleries. Instead of writing HTML links and let Milkbox to automatically collect them, you can write one or more galleries via XML and load them with the addGalleries() method. You can then show any file of any gallery with a single JavaScript or ActionScript (Using ExternalInterface) call, and with custom auto-play options.
* Launch from JavaScript. You can use showGallery() to launch any gallery item with custom autoplay options from JavaScript and therefore, even from Flash via ExternalInterface.
* Milkbox hides select and textarea tags while playing; also, there’s a option (removeTitle) that lets you decide if the browser will pop up or not his default tooltips when you hover the Milkbox links. Defaults to true.
* ImageOfText option. If your lang is not eng, and don’t want to see “1 of 15″, just use this option. I’m italian, so I usually set it to ‘di’. Defaults to ‘of’.
* Transitions are minimal: I like fast navigation. Anyway, you can use any of the MooTools’s Fx.Transitions effects.
* Next and prev buttons are in the bottom section, near the close button. This way I think I make it more usable by not hiding anything and keeping the navigation all in one place.
Also there’s a loop in the next and prev buttons: if Milkbox is showing the last image in the gallery and you click the next button, it will let you see the first image; similarly if you’re seeing the first one, the last one will be shown by clicking the prev button.
And last but not least, there’s an auto-sizing border-left in the nav section, that helps to visually separate the buttons from the caption.
* Keyboard navigation:
• Next image: right arrow or space bar
• Previous image: left arrow
• Close milkbox: esc key
* The close button is just a cross, no ‘close’ word: this way no language is involved.
In fact, there are 3 ways to close it: click the close button; click the overlay; press the esc key.
* All the graphic interface is customizable via CSS or js options. You can even download the buttons graphics (.psd and .ai) and modify them!
* YUI compressed. The files you’ll find in the download section, include a lighter yui-compressed version (milkbox-yc.js)

How to use Milkbox
1. Make sure that there is a XHTML DOCTYPE declaration at the very top of the page. XHTML transitional or strict are good.

 HTML |  copy code |? 
1
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  
2
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
3
2. Include the milkbox.css file in your page. Make sure the referenced images are in the right location. I suggest to leave them in the milkbox css folder.

 HTML |  copy code |? 
1
<style type="text/css"> 
2
      	@import url(css/milkbox/milkbox.css); 
3
      </style> 
4
3. Include the mootools 1.2 js library. The core js must have the following components:
* - The core library.
* - The Assets plugin
 Javascript |  copy code |? 
1
      <script type="text/javascript" src="js/mootools-1.2.3-core-yc.js"></script> 
2
      <script type="text/javascript" src="js/mootools-1.2.3.1-more.js"></script> 
3
4. Include the milkbox.js or (maybe better) the milkbox-yc.js file.

 HTML |  copy code |? 
1
  <script type="text/javascript" src="js/milkbox.js"></script>

5. Add a rel="milkbox" attribute to any link tag to activate the Milkbox. Optionally, add a title attribute. If you have a set of related images that you would like to group, include a group name between square brackets in the rel attribute, or separate it from the 'milkbox' word with some other character: for example, if you'd like to validate your page as xhtml 1.1, you could use a colon or an underscore.
If you want to add tags inside the title property (for example a link), please use html entities and no quotes, then eventually style them with css: the relevant id is #mbDescription.

 HTML |  copy code |? 
1
<a href="img/01b.jpg" rel="milkbox[gall1]" title="Caption goes here...">image #1</a> 
2
      <a href="img/02b.jpg" rel="milkbox[gall1]" title="Caption goes here...">image #2</a> 
3
      <a href="img/03b.jpg" rel="milkbox[gall1]" title="Caption goes here...">image #3</a> 
4
Example for xhtml 1.1 validation - A colon instead of the square brackets:

 HTML |  copy code |? 
1
      <a href="img/01b.jpg" rel="milkbox:gall1" title="Caption goes here...">image #1</a> 
2
      <a href="img/02b.jpg" rel="milkbox:gall1" title="Caption goes here...">image #2</a> 
3
      <a href="img/03b.jpg" rel="milkbox:gall1" title="Caption goes here...">image #3</a> 
4
 
5
If a link points to an swf file, add a rev attribute with comma-separated width/height values:

 HTML |  copy code |? 
1
      <a href="swf/banner.swf" rel="milkbox[gall1]" rev="width:600,height:200"  
2
      title="Caption goes here...">image #1</a> 
3



Demo: http://reghellin.com/milkbox/
Download: http://www.reghellin.com/milkbox/milkbox2.3.0.zip
Source: http://reghellin.com/milkbox/
tafbutton blue16 Milkbox using Mootools

Related Listings:

  1. Smoothbox, Thickbox for mootools Smoothbox is the Mootools conversion of Thickbox, a script running...
  2. Photo gallery with MooTools Photo Gallery is a open source gallery built with Mootools...
  3. Zoomimage- Jquery Script Present you images in stylish way. The links are unobtrusively...

FancyBox using Jquery

Posted: 14 Sep 2009 08:48 PM PDT

FancyBox is tool for displaying images, html content and multi-media in a Mac-style “lightbox” that floats overtop of web page.
It was built using the jQuery library. Licensed under the MIT License

Features:

* Adds a nice drop shadow under the zoomed item
* Groups related items and adds navigation (preloades images)
* Can display images, inline, ajax and iframed content
* Customizable through settings and CSS
* Support fancy transitions by using easing plugin

How to implement

First, make sure you are using valid DOCTYPE, this is required for FancyBox to look and function correctly.

1. Include nessesary JS files
 Javascript |  copy code |? 
1
<script type="text/javascript" src="path-to-file/jquery.js"></script> <script type="text/javascript" src="path-to-file/jquery.fancybox.js"></script> Optional, add if you wish to use fancy transitions as jQuery by default supports only "swing" and "linear" <script type="text/javascript" src="path-to-file/jquery.easing.js"></script>
2. Add FancyBox CSS file
Don`t forget to change image paths if CSS file is not in the same directory as images used by FancyBox
 HTML |  copy code |? 
1
<link rel="stylesheet" href="path-to-file/fancybox.css" type="text/css" media="screen">  
2
</link>
3. Create a link element
(< a href >) For images
 HTML |  copy code |? 
1
<a id="single_image" href="image_big.jpg"><img src="image_small.jpg" alt=""/></a> Inline content <a id="inline" href="#data"></a>
This shows content of element who has id="data"< /a >
Iframe:
 HTML |  copy code |? 
1
<a href="http://www.example?iframe">This goes to iframe</a> or <a class="iframe" href="http://www.example">This goes to iframe</a> Ajax <a href="http://www.example/data.php">This takes content using ajax</a>
Optional: Use the title attribute if you want to show a caption
Note: You may want to set hideOnContentClick to false if you display iframed or inline content and it containts clickable elements (for example - play buttons for movies, links to other pages)

4. Fire plugin using jQuery selector
If you are not familiar with jQuery, please, read at least this tutorial for beginners
Sample examples:
 Javascript |  copy code |? 
1
$(document).ready(function() { /* This is basic - uses default settings */ $("a#single_image").fancybox(); /* Using custom settings */ $("a#inline").fancybox({ 'hideOnContentClick': true }); $("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false }); });
Galleries are created from found anchors who have the same "rel" tags




Demo: http://fancybox.net/example
Download: http://code.google.com/p/fancybox/downloads/detail?name=jquery.fancybox-1.2.1.zip
Source: http://fancybox.net/
tafbutton blue16 FancyBox using Jquery

Related Listings:

  1. jQuery ThickBox Script ThickBox is a webpage UI dialog widget written in JavaScript...
  2. ClockPick – JQuery Plugin ClockPick – A JQuery plugin that enables you to add...
  3. jQuery FrameReady The best way to see how this works is to...

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.