MagicToolBox forum
May 17, 2012, 01:01:06 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the Magic Toolbox forum!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Browser crash workaround?  (Read 1077 times)
streettb1
Newbie
*
Posts: 2


View Profile
« on: April 23, 2010, 06:05:36 pm »

I have read the thread "Browser crashes while using Magic Magnify"
regarding the maximum # of swf instances per page, and I was wondering if there is a workaround to this?

I'm trying to integrate the Magic Magnify component here: http://www.weparty.com/productstest.asp

(as you can see, there will be at least 30 thumbnail/large image pairings per category)

However, whenever I start to reference the id of the large image with the thumbnails (e.g., <a href="" rel="large_image_id">)
the browser crashes.

Any workarounds to this issue?

Logged
igga
MagicToolBox Team
Sr. Member
*****
Posts: 331



View Profile WWW
« Reply #1 on: April 24, 2010, 04:32:42 am »

Hi,

If you have such number of thumbnails you can try not connect thumbnails using REL. You can try to change Magic Magnify image manually using following function:

function MMaddEventListener(obj, event, listener){
   var mt_ua = 'msie';var W=navigator.userAgent.toLowerCase();if(W.indexOf("opera")!=-1){mt_ua='opera';}else if(W.indexOf("msie")!=-1){mt_ua='msie';}else if(W.indexOf("safari")!=-1){mt_ua='safari';}else if(W.indexOf("mozilla")!=-1){mt_ua='gecko';}
    if(obj.addEventListener){
        obj.addEventListener(event, listener, false);
    } else if (mt_ua == 'msie') {
        obj.attachEvent("on"+event,listener);
    }
};

function changeImage(elm) {

   var smallImage = elm.rev;
   var largeImage = elm.href;

   MagicMagnify_stopMagnifiers();
     document.getElementById('mmp').href = largeImage;
     document.getElementById('mmp').className = "MagicMagnify";     
   MMaddEventListener(document.getElementById('lgImg'), "load", function(){
      MagicMagnify_findMagnifiers(true);
   } );     
     document.getElementById('lgImg').src = smallImage;
     
}

So you can use thumbnails like following:

<a href="..big image url.." rel="mmp" rev="..small image url.." onclick="changeImage(this); return false;">..</a>
Logged

MagicToolbox.com Support Team
streettb1
Newbie
*
Posts: 2


View Profile
« Reply #2 on: April 28, 2010, 04:21:29 pm »

Thank you for the quick answer.

I was able to implement your code and it works: http://www.weparty.com/productstest.asp

As a follow-up question, If I wanted just one large image to be magnified, as opposed to two separate images for small and large, would I delete the "rev" reference in the code or just place the big image URL in href and rev (e.g., <a href="..big image url.." rel="mmp" rev="..big image url.." onclick="changeImage(this); return false;">..</a>)?
Logged
igga
MagicToolBox Team
Sr. Member
*****
Posts: 331



View Profile WWW
« Reply #3 on: April 28, 2010, 04:53:28 pm »

Unfortunately this is impossible to use only one large image. This is a subject of customization and will take about 4-5 hours. http://www.magictoolbox.com/support/
Logged

MagicToolbox.com Support Team
Pages: [1]
  Print  
 
Jump to:  

MagicZoom™ | Magic Zoom Plus™ | Magic Scroll™ | Magic 360™ | Magic Slideshow™ | Magic Touch™ | Magic Thumb™ | Magic Magnify Plus™
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC