(function() {

// MAXB.NET LABS

})();

javascript, jbgallery, jquery, plugins

jbgallery 1.0

Posted on by Massimiliano Balestrieri | Comments (50)
ATTENTION : jbgallery 3.0 BETA

DEMO SITE

jbgallery is a webpage UI widget written in javascript on top of the jQuery library.
Its function is to show a single big image, multiple images, multiple gallery, slideshow, as site’s background or in “dialog” mode or as a common pop-up
jbgallery has two basic menus, one has music player buttons the other gives directly links to single images.
jbgallery provides a pubblic API to remote control the component, so it would be easier to bind also with a more complex menu (i.e. with thumbnails).

Examples:

Installation

Download and extract

jbgallery-1.0.zip

Or download single files :

Scripts js (include in head tag)

<script type="text/javascript" src="jquery.1.3.2.min.js"></script>
<script type="text/javascript" src="jbgallery-1.0.min.js"></script>

HTML structure

<div class="jbgallery">
  <ul>
    <li><a href="1.jpg" title="alternative text">1</a></li>
    <li><a href="2.jpg" title="alternative text">2</a></li>
    <!-- etc -->
  </ul>
</div>

JS

<script type="text/javascript">
jQuery(window).jbgcss("jbgallery.css");//customize url
jQuery(document).ready(function(){
  jQuery(".jbgallery").jbgallery();
});
</script>

OPTIONS & DEFAULTS

Write options HERE :


jQuery(".jbgallery").jbgallery({HERE});
[/code]

DEFAULTS

{
  style     :  "zoom",    //"centered", "zoom"
  slideshow :  false,
  menu      :  "simple",  //false, "numbers", "simple"
  interval  :  4000,
  fade      :  false,
  fade_time :  400,
  shortcuts :  [37,39],   //left and right arrows
  before    :  function(){}
  load      :  function(ev){},
  after     :  function(ev){},
  popup     :  false,
  close     :  function(ev){},
  labels    :  {
        play : "play",
        next : "next",
        prev : "prev",
        stop : "stop",
        close: "close"
  }
}

OPTIONS

  • style : string ('zoom'/'centered')
  • slideshow : boolean (true/false)
  • menu : string/boolean ('simple'/'numbers'/false)
  • interval : number (milliseconds for slideshow)
  • fade : boolean (false/true)
  • fade_time : number (milliseconds for fadeIn/fadeOut effect)
  • shortcuts : array (keycodes for trigger events left/right via keyboard)
  • before : function (callback)
  • load : function(ev) (callback - native image load event)
  • after : function (callback)
  • popup : boolean (show close button)
  • close : function(ev) (callback after click close button. i.e. window.close())
  • labels: object - default:

    {
    play : "play",
    next : "next",
    prev : "prev",
    stop : "stop",
    close: "close"
    }

API (developers/designers)

  • jQuery("#jbgallery").jbgallery(); // build object FIRST
  • jQuery("#jbgallery").jbgallery("go" , 2); // trigger event go, go to photo 2 if exist
  • jQuery("#jbgallery").jbgallery("left"); // trigger event left (prev)
  • jQuery("#jbgallery").jbgallery("right"); // trigger event right (next)
  • jQuery("#jbgallery").jbgallery("play"); // trigger event play - autoplay start
  • jQuery("#jbgallery").jbgallery("stop"); // trigger event stop - autoplay stop
  • jQuery("#jbgallery").jbgallery("destroy"); // destroy object, events, expando
  • jQuery("#jbgallery").jbgallery("current"); // return number of current photo

CONTENTS/FURTHER ELEMENTS

To add to the image further contents or other kind of elements you can use the following div. Otherwise you can add other divs copying the styles below.

<div id="jbg-content">
    <!-- PUT HERE CONTENT -->
    <div id="docs">
        <div class="wrapper">
        </div>
    </div>
    <!-- /PUT HERE CONTENT -->
</div>
#docs{width:500px;right:200px;top:15%;position:absolute;z-index:1000;}
#docs .wrapper{padding:10px;margin:10px;background:#fff;}

BROWSERS TESTED

  • Firefox 3 (winxp/linux)
  • Safari 3.2, 4 (winxp)
  • Chrome 1/2 (winxp)
  • Opera 9.6/10 (winxp/linux)
  • Internet Explorer 6/7/8 (winxp)
  • Konqueror 4.2.1 (linux)

KNOWN BUGS

Opera

I can't prevent on the keydown default event (arrows) in Opera.
At "arrows" keydown that causes a pervers effect.
If you know a solution, please contact me.

DESIGN/GRAPHIC

The component is published with a minimalist graphic layout.
You are free to customize css and to ask me any change to add classes to the simple menus edited by me.
If you use API or design more complex menus, or if you write plugins populating html lists via ajax by flickr
or similar services, please share with me for the next version of this plugin.

CREDITS

This work is inspired by http://www.ringvemedia.com/ and Chicca

Photos by Chicca Vancini.
Thanks to Carlo.
Depends by jquery-1.3.2 by John Resig.

LICENSE

Copyright (c) 2009 Massimiliano Balestrieri
Licensed GPL licenses:
http://www.gnu.org/licenses/gpl.html

ie

Forse è la volta buona!

Posted on by Massimiliano Balestrieri | Comments Off

“InfoWorld’s Randall Kennedy reports on rumors that IE8 may be Internet Explorer’s swan song: ‘IE8 is the last version of the Internet Explorer Web browser,’ Kennedy writes. ‘It seems that Microsoft is preparing to throw in the towel on its Internet Explorer engine once and for all.’ And what will replace it? Some are still claiming that Microsoft will go with WebKit, which is used by Safari and Chrome. The WebKit story, Kennedy contends, could be a feint and that Microsoft will instead adopt Gazelle, Microsoft Research’s brand-new engine that thinks like an OS. ‘This new engine will supposedly be more secure than Firefox or even Chrome, making copious use of sandboxing to keep its myriad plug-ins isolated and the overall browser process model protected.’”snydeq

http://tech.slashdot.org/article.pl?sid=09/03/10/1942232

javascript, jquery, ycodaslider

YCodaSlider 3.0 – Click’n’Play + Autoplay

Posted on by Massimiliano Balestrieri | Comments Off

Ecco due snippets di codice per avere l’autoplay dello “slider” e il play sul click sull’immagine.
Per ora sono snippets di codice esterni alla libreria.
Nella futura versione ci saranno le opzioni

  • autoplay
  • clicknplay (ycodagallery)


AUTOPLAY GALLERY + LAZYLOAD

jQuery(window).ycodacss('ycodaslider-3.0.css');
jQuery(window).ycodacss('ycodaslider-3.0.css');
jQuery(document).ready(function() {
	jQuery("#panel-gallery")
    .ycodagallery()
    .ycodalazy();
});
jQuery(window).bind("load", function() {
    jQuery("#panel-gallery")
    .ycodaslider({
    	navigator: false,
    	arrows : false
    });

    setInterval(function(){
    	jQuery("#panel-gallery").ycodaslider("right");
    }, 2000);
});

AUTOPLAY SLIDER

jQuery(window).ycodacss('ycodaslider-3.0.css');
jQuery(window).bind("load", function() {
    jQuery("div.ycodaslider")
    .ycodaslider({arrows: false, navigator: false});

    setInterval(function(){
    	jQuery("div.ycodaslider").ycodaslider("right");
    }, 2000);
});

CLICK’N'PLAY

jQuery(window).ycodacss('ycodaslider-3.0.css');
jQuery(window).bind("load", function() {
    jQuery("#panel-gallery")
    .ycodagallery()
    .ycodaslider({navigator: false, arrows: false});

    jQuery("#panel-gallery").find("img").wrap('<a href="#">');
    jQuery("#panel-gallery").find("a").click(function(){
    	jQuery("#panel-gallery").ycodaslider("right");
    	return false;
    });
});

javascript, jquery, plugins, ycodaslider

YCodaSlider 3.0 – Changelog

Posted on by Massimiliano Balestrieri | Comments (11)
  • updated to jquery 1.3.2
  • scrolltop: very important when “panels” have contents of different hights
  • unstable piece of code have been delated: ycodaframe, history option
  • dragging option and dependence from jQuery UI (basically unusefull) have been delated
  • plugins in 2.0 (gallery, lazyload, feeds, code) now have been unified in a single file (easier to use. only 5KB the packed version. 9 KB the minified version)
    • jQuery(window).ycodacss ->to load the css.
    • jQuery(selector).ycodaslider -> to start up the component.
    • jQuery(selector).ycodagallery -> prepares a list of images. To be used “in chain” with ycodaslider.
    • jQuery(selector).ycodalazy -> starts up the lazyload on the list of images. To be used “in chain” with ycodagallery in event ready.  Launch ycodaslider on the event load.
    • jQuery(selector).ycodacode -> prepares a list of links to sources, to be used “in chain” with ycodaslider. (optional jQuery Chili 2.2)
    • jQuery(selector).ycodafeeds -> prepares a list of links to rss sources,  to be used “in chain” with ycodaslider. (needs  jQuery gFeeds e API google)
  • I only kept separate the plugin fickr, which is just an example of how you can link ycodaslider
    • jQuery(selector).ycodaflickr -> example of external component. (see also ycodagallery, ycodacode e ycodafeeds to write plugins for ycodaslider)
  • jquery easing is no longer essential: jquery 1.3 has the swing effect as a default animation. Simply set at 0 the parameter easeTime if you don’t  want to have animation.
  • default keyboards shorcuts  are now the two arrows left & right (keyboard codes are the same in all platforms)
  • I made a API using jquery UI style:
    • jQuery(selector).ycodaslider(“right”); -> invoke event right. ycodaslider will move right.
    • jQuery(selector).ycodaslider(“left”); -> invoke event left. ycodaslider will move left.
    • jQuery(selector).ycodaslider(“go”, N); -> invoke event go where N is the number of the panel to visualize (starting from 0)
    • jQuery(“#id”).ycodaslider(“currrent”); -> returns the panel active
    • jQuery(“#id”).ycodaslider(“count”); -> returns the number of panels
    • jQuery(“#id”).ycodaslider(“width”); -> returns the width of the component
  • complete code refactory
  • possibility of tracking click with janalytics plugin to have the statistics (google analytics)
  • a single css (easy to customize – the design of the demo has a minimalist design)
  • easier to use
  • tested on the following browser:
    • firefox 3 (linux/windows xp)
    • internet explorer 6/7
    • chrome (windows xp)
    • safari 3.2.2/safari 4Beta (windows xp)
    • opera 9.6 (windows xp)
  • known bugs
    • IE6: the last panel sometimes literally fall under the second last, leaving empty the last card

if  you have any suggestions, if you find a bug or you use the plugin, please leave a comment here.
PS: Carlo… spero vada bene :)

UPDATE 2008-03-09 :