Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6736251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:06:28+00:00 2026-05-26T11:06:28+00:00

I am using Cloud Zoom jQuery plugin to Apply image zoom effect. The basic

  • 0

I am using Cloud Zoom jQuery plugin to Apply image zoom effect. The basic requiremenmt was to have a tag with called cloud-zoom surrounded to it. But I am just taking with source and dynamically wrapping with cloud-zoom class. Then i am trying to load the Cloud-zoom’s JS and CSS files. But i am unable to achieve this..
My code is given below..

function zoomer(type,size)
{
var str="";
str+= '<script type="text/javascript" src="/jQueryLatest/jquery-1.6.4.min.js"></script>'
str+= '<script type="text/javascript" src="/5.js"></script>'
str+= '<script type="text/javascript">'
str+= "$(document).ready(function()"
    str+= "{"
            str+= "$('img.make').each(function()"
            str+= "{"
                         str+= "var $this=$(this);"
                         str+= "$this.resize("+size+");"
                         str+= "var zoomStr=zoomString($this,"+type+");"
                         str+= "$this.wrap(''+zoomStr+'');"
                         str+= "disableRightClick();"
                         str+= "});"
                         str+= "loadPlugin(";
                         str+= type;
                         str+= ");"
    str+= "});"
str+= "</script>"
return str;
}

And the loadPlugin Function is

function loadPlugin(choic)
{
    var plug=choic;
    if(plug >= 1 && plug <= 4)
    {
        var Code='<link href="http://www.professorcloud.com/styles/cloud-zoom.css" rel="stylesheet" type="text/css" />'
        Code+= '<script type="text/javascript" src="http://www.professorcloud.com/js/cloud-zoom.1.0.2.js"></script>'
        $('a.cloud-zoom').live('click',function(e)
        {
            e.preventDefault();
        });
        return Code;
    }       
}

and zoomString function is

     function zoomString(ele,choice)
{
    var str="";
    if(choice == null) choice = 1;
    var src = ele.attr('src');
    switch(choice)
    {
        case 1:
            str = '<a href="' + src + '" class="cloud-zoom" rel="adjustX: 10, adjustY:-4" target="_blank"/>';
            break;
        case 2: 
            str = '<a href="' + src + '" class="cloud-zoom"'; 
            str+= 'rel="'+"position:'inside', showTitle: false, adjustX:-4, adjustY:-4"+'" target="_blank"/>';
            break;
        case 3:
            str = '<a href="' + src + '" class="cloud-zoom"'; 
            str+= 'rel="'+"tint: '#E8E8E8',tintOpacity:0.5 ,smoothMove:5,zoomWidth:480, adjustY:-4, adjustX:10"+'" target="_blank"/>';
            break;
        case 4:
            str = '<a href="' + src + '" class="cloud-zoom"';
            str+= 'rel="'+"softFocus: true, position:'anypos', smoothMove:2"+'" target="_blank"/>';
            break;
    }
    return str;
}

But I am able to get the effect with static loading of Script file.. But i want to make this optional so dont want to make this loaded on load.

Please help me on this..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:06:29+00:00Added an answer on May 26, 2026 at 11:06 am

    You are loading a script dynamically, but it’s code is wrapped in document.ready which is an event that fires only when the page (mostly) finished loading. It’s already come and gone when you load the script, so it will never run.

    Just remove this wrapper.

    str+= "$(document).ready(function()"

    … and why not just use $.getScript anyway? Embedding javascript as string literals is tedious and error prone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image viewer using a js module called cloud zoom. It works
I'm using the jQuery plugin Cloud Zoom, and I've altered the initialization so that
I'm trying to create a dynamic tag cloud using jquery, I want it to
Hi I am trying to write a tag cloud using jquery xml+MySql and php.
I've implemented a tag cloud on a site of mine, and I'm using a
I'm using Rackspace Cloud Servers. I have installed NGINX with PHP and Memcache. When
I'm using a UEC Cloud (with kvm) Can I restore an image, in a
I would like to display a tag cloud in my test application using a
I am using tagcloud_0.4.jar for using Tag Cloud in GWT. Now, when I click
I am using a databound DataList in ASP.NET C# to create a tag cloud.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.