MB Blogg
Start Sidor
Kategorier Arkiv Författare Feeds

Exclusive Accordion v2.0

2012-02-10 - kl 18:21:09 Postat av

# CHANGELOG #
2011-11-12: Updated to use the new .on() event API method.

$(document).ready(function(){

   /* Vars for performence caching */
   var cH = $('.cHolder');
   var cT = $('.toggler');

   /* some settings vars */
   var easeName = 'easeOutBack';
   var slideDur = 2000;

   /* Hide the content and load in some example text from lipsum.php with AJAX into the inner DIV */
   cH.hide(0);
   cH.find('div.lipsum').load('lipsum.php');

   /* Start with the first content holder open at page load */
   cH.first().show(0);

   /* the event handler responsible for toggling content */
   cT.on('click', function(e)
   {

      /*
         We save this object to compare later with the
         current looped toggler object further down.
      */
      var clickTargetObj = $(this);

      /* Loop through all togglers */
      cT.each(function(index, theElement)
      {

         /*
            We check to see if the current iteration $(this) object
            match with the $(this) clicked object outside our loop.
            If so, then the .is() method returns TRUE and we act upon that.
         */
         var curTargetObj = $(this);

         if(clickTargetObj.is(curTargetObj))
         {

            /*
               Use the current iteration object with the .next()
               method to find out wich content holder to toggle.
            */
            curTargetObj.next().slideToggle(slideDur, easeName);

         } else {

            /*
               If the current iteration object is not the same as the clicked toggler  we
               use the .next() method instead to hide the content holder right after it.
            */
            curTargetObj.next().slideUp(slideDur, easeName);

         }

      });

      e.preventDefault();

   });

   /* the event handler responsible for closing all open content containers */
   $('.cAll').on('click', function(e)
   {

      /*
         We use the .slideUp() method here because it will slide up all open containers.
         If we would have used the .slideToggle() method the closed ones would
         open and the open ones close and there would be chaos.
      */

      /* close all open content holders */
      if($(this).attr('title') === 'closeAll')
      {
          cH.slideUp(slideDur, easeName);
      }

      /* Open all closed content holders */
      if($(this).attr('title') === 'openAll')
      {
          cH.slideDown(slideDur, easeName);
      }
      e.preventDefault();

   });

});

Länkar integreras i bloggen

2012-02-08 - kl 23:42:29 Postat av

Har ikväll överfört dom länkar jag anser vara av värde till bloggen och den nya designen. Jag kommer gå igenom dessa länkar under veckorna och rensa bort inaktuella och felaktiga länkar. Som vanligt tar jag inget ansvar för innehållet på dessa länkar och dom besöks på egen risk. Längre fram kommer länk arkivet stängas och då finnes länkarna enbart på bloggen.

Nytt blogg theme

2012-02-06 - kl 22:53:10 Postat av

Jag har börjat koda på ett nytt WordPress Theme för bloggen, det är aktiverat i skrivande stund. Det kommer förmodligen fler små justeringar innan jag är nöjd.

Vissa problem kan uppstå vid dessa justeringar så jag ber er besökare ha överseende med detta.

Länge har jag funderat på att skapa ett nytt theme som är ”luftigare” och fokuserar på texten och innehållet. Nyckelord är lättläst, rent, tydligt, och rena klara färger.

© Copyright & WP Theme by Magnus Bonnevier, 2012. Powered by: WordPress 3.3.1