? galleryformatter-986474.patch
Index: theme/galleryformatter.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/galleryformatter/theme/galleryformatter.js,v
retrieving revision 1.1.2.10
diff -u -p -r1.1.2.10 galleryformatter.js
--- theme/galleryformatter.js	19 Oct 2010 14:54:29 -0000	1.1.2.10
+++ theme/galleryformatter.js	3 Dec 2010 18:01:07 -0000
@@ -14,6 +14,14 @@ Drupal.galleryformatter.prepare = functi
   // var $settings = Drupal.settings.galleryformatter;
   var $el = $(el);
   var $slides = $('li.gallery-slide', $el);
+  var slidesufix = '-js';
+
+  // add prefix to each li id for deeplinking porpuses
+  $slides.each(function(){
+    var $this = $(this);
+    var id = $this.attr('id') + slidesufix;
+    $this.attr('id', id);
+  });
 
   var $thumbs = $('.gallery-thumbs', $el);
   var $thumbsLi = $('li', $thumbs);
@@ -41,7 +49,8 @@ Drupal.galleryformatter.prepare = functi
    * figure out how to get this into proper functions reusing selections
    */
   $thumbslinks.click(function(e){
-    var $hash = $(this.hash);
+    var $hash = $(this.hash + slidesufix);
+
     if(!$hash.is(':visible')){
       $thumbsLi.removeClass('active');
       $(this).parent().addClass('active');
@@ -54,14 +63,14 @@ Drupal.galleryformatter.prepare = functi
        */
       // window.location.hash = this.hash;  // not sure if this is the best way to do it.
     }
-    e.preventDefault();
+   // e.preventDefault();
   });
 
   /*
    *  Startup behaviour (when the page first loads)
    */
   $slides.hide(); // hide all slides
-  var $locationHash = window.location.hash; // if we are being deeplinked to a specific slide, capture that
+  var locationHash = window.location.hash; // if we are being deeplinked to a specific slide, capture that
 
   function showFirstSlide(){
     $slides.filter(':first').show(); // show the first one
@@ -69,12 +78,12 @@ Drupal.galleryformatter.prepare = functi
   }
 
   // if we have a hash in the url
-  if ($locationHash) {
-    var $slideToShow = $slides.filter($locationHash);
+  if (locationHash) {
+    var $slideToShow = $(locationHash + slidesufix);
     // if the hash corresponds to one of our slides
     if ($slideToShow.length > 0) {
       $slideToShow.show(); //  show that slide
-      $thumbsLi.not($(".cloned")).find("a[href="+$locationHash+"]").parent().addClass('active'); // activate that thumbnail
+      $thumbsLi.not($(".cloned")).find("a[href="+locationHash+"]").parent().addClass('active'); // activate that thumbnail
     }
     // otherwise the default
     else {
