Cestfait.ch

  • Home
  • Drupal
  • PHP 5
  • Jquery
  • Web Dev
  • Sys admin
  • Logiciels libres
  • Videos
  • Divers
  • Nous contacter
  • Mon c'est fait!
Home

Jquery cycle

Submitted by Sir Squall on Tue, 04/12/2011 - 10:13

Bon tous le monde connais jquery cycle, et tous le monde sais faire des petits carrousels, mais ce qui est plus club a faire c'est un petit "after" qui affiche la title et le alt de l'image:

 

 

/**
 *Gets javascript settings for slideshow and sets up Drupal behaviour
 *
 *@param string $jq_slideshow_id dom id of slideshow
 *@param string $preset imagecache preset name
 *
 */
function THEME_jquery_slideshow_get_settings($jq_slideshow_id, $preset) {
 
  jquery_plugin_add('cycle');
  $data = _jquery_slideshow_get_actions($preset);
 
  $script = "Drupal.behaviors.jquerySlideshow = function(){
        $('.jquery_slideshow').css({height:'400px'});
        $('.jquery_slideshow').css({width:'600px'});
        $('#". $jq_slideshow_id ."').cycle({
          fx: '". variable_get('jquery_slideshow_effect', 'fade') ."',
          speed: ". variable_get('jquery_slideshow_speed', 500) .",
          timeout: ". variable_get('jquery_slideshow_timeout', 4000) .",
          next:   '#next', 
          prev:   '#prev',
          after:   onAfter
        });
      };";
 
  $script .= "function onAfter(curr, next, opts) {
	             //get the current img
               $('#slideshow img').each(function(){
                   if( $(this).is(':visible') ) {
    	                $('.slideshowinfo').remove();
                      if($(this).attr('title') || $(this).attr('alt')){
    	                  $(this).parent().parent().append('<div class=\"slideshowinfo\"><h2>'+$(this).attr('title')+'</h2><p>'+$(this).attr('alt')+'</p>');
    	                  $('.slideshowinfo').fadeIn(500);
                      }
    	              }
               });
    }";
 
  drupal_add_js($script, 'inline');
}

C'est fait !!!

0
Log in to vote
No votes yet
  • Login or register to post comments
  • Share this
Tags:
  • Jquery

2 reponses to "Jquery cycle"

1. yep je vais faire un petit

Submitted by Sir Squall on Thu, 04/14/2011 - 09:42.
yep je vais faire un petit slide de demo ;) sur : http://demo.cestfait.ch/
  • Login or register to post comments

2. Pas d'exemple????

Submitted by FiG on Wed, 04/13/2011 - 09:51.
Pas d'exemple????
  • Login or register to post comments

User login

  • Create new account
  • Request new password
  • Sign in with Twitter

Translate

Sondage

Qu'elle version de drupal utilisez-vous ?

Submitted by Sir Squall on Tue, 04/10/2012 - 16:30
  • Login or register to post comments

Recent comments

  • Arf, je suis à l'armée!
    40 weeks 1 day ago
  • hahaha c'est juste! Il n'y a
    46 weeks 4 days ago
  • yeah comme sa fait plaisir de
    46 weeks 6 days ago
  • wouahou merciii :-) !
    50 weeks 5 days ago
  • J'y réponds aujourd'hui ici
    50 weeks 5 days ago
  • Salut, court article mais
    50 weeks 6 days ago
  • Oktoberfest power!!!
    1 year 3 weeks ago
  • yep je vais faire un petit
    1 year 5 weeks ago
  • It's regular approuved
    1 year 5 weeks ago
  • Pas d'exemple????
    1 year 5 weeks ago

Tags

cropping Divers drupal Drupal emacs firefox gmap Google Images Jquery jquery karmic koala La phrase du jour Lausanne Logiciels libres mysql PHP 5 RPG Sys admin ubuntu Web Dev yasnippet youtube Zend
more tags

Popular content

Today's:

  • Squall Beer Challenge '09
  • Grep afficher les lignes avant et après
  • 8ème Forum eCulture - ERACOM - 4 septembre 2009
  • Trip to antwerpen !
  • viportuguese-shop.com
  • Emacs Transparent
  • Boxxy likes Drupal
  • [Drupal] Lightbox avec une gmap! yeah
  • Drupal solr attachement intégration
  • forcer le téléchargement

All time:

  • Drupal 7 effet avec les jquery.ui.dialog sur Drupal 6 !
  • Dries Keynote DrupalCon Paris 2009
  • Drupal bridge zend yeah !!
  • Jquery slider c'est de la bonne !!!
  • Drupal and Zend, form validate :)
  • Jquery JSON en _POST
  • [Drupal] Lightbox avec une gmap! yeah
  • [Drupal] Domain Access & memcache sa donne quoi ?
  • viportuguese-shop.com
  • Node Import et Taxonomy CSV

Last viewed:

  • Journée Mondiale contre les DRM
  • jeu de rôle de malade!
  • Drupal tabs
  • Java-4 Ever
  • [Drupal] Lightbox avec une gmap! yeah
  • Get the list of all enabled module
  • J'ai pas pu m'empêcher
  • It is finally here!
  • IPV6, are you ready ?
  • Ipad

Twitter

Latest Articles

Derniers liens publiés

  • Get the list of all enabled module
    http://drupal.org/node/440962
  • Cloudflare et Dropbox nommés Technology pioneers
    http://techcrunch.com/2011/09/01/cloudflare-dropbox-palantir-and-kickstarter-named-technology-pioneers-by-the-world-economic-forum/
  • Apprend le javascript en t'amusant
    http://www.codecademy.com
  • EPSACrop sur Drupal 7
    http://www.aswissidea.org/
  • Drupal solr attachement intégration
    http://tika.apache.org/

Pub

Google gadget

Add to Google

Facebook page

jiwa

all good song

Partenaires

Cyber Warfare

Drupal Factory

Dev Factory

I love Smashing Magazine!
Fervens Drupal theme by Leow Kah Thong. Designed by Design Disease and brought to you by Smashing Magazine.