Solved

Why my jQuery plugin isn't working?

Posted on 2011-03-14
9
274 Views
Last Modified: 2012-05-11
Hi, I'm ref this url, http://fstoke.me/jquery/window/.  Please see my code in the attached file.
Nothing happens when I click on the image.  Thank you.
htmlJquery.txt
0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 35135339
>> <link type="text/javascript" href="/jQuery/jquery-window-5.01b" />
?? you probably meant to link a CSS file

on Lines 21 and 31 you need to escape the double quotes - ex:
 content: "<div style="padding: 10px; font-weight: bold;">I only can be dragged within body element."+

should be:
 content: "<div style=\"padding: 10px; font-weight: bold;\">I only can be dragged within body element."+
0
 

Author Comment

by:lapucca
ID: 35135412
Hi, yeah, I noticed those problem already and modified it.  You should see that in the attached file.  I'm also attaching the jquery.window.css file.  I think I'm supposed to use the "window" class to use this plugin but there is no class named as window in there.  If you look at the web site, I wonder where is that .window coming from?  Thank you.
Also, Ho can I get a hand-icon when mouse over the image.  Thanks.
0
 

Author Comment

by:lapucca
ID: 35135421
Actually, it would be most helpful if someone can point me to some sample code how this is done.  On the site I ref, it doesn't provide the source code for the whole thing.  
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 9

Assisted Solution

by:Roman Gherman
Roman Gherman earned 200 total points
ID: 35135447
Hi,

To get a hand-icon when mouse over the image add style attribute to it:
<img src="r3_c1_s1.png" alt="Dash Control 3!" style='cursor: pointer;' onclick="CreateControl3Window" />

Open in new window


The $.window is function which is declared in your jquery.window.min.js file.
$.window=function(options) ......

By the way, why you don't have .js at the end of each javascript file? maybe this is your problem?

Try instead of this:
    <script type="text/javascript" src="/jQuery/jquery-1.5.1.min"></script>
    <script type="text/javascript" src="/jQuery/jquery-window-5.01b/jquery.window.min"></script>

Open in new window


To put this:

    <script type="text/javascript" src="/jQuery/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="/jQuery/jquery-window-5.01b/jquery.window.min.js"></script>

Open in new window


-------------------------------------------------------
You can find me on: http://extremedev.blogspot.com
0
 
LVL 82

Accepted Solution

by:
hielo earned 300 total points
ID: 35135477
>>On the site I ref, it doesn't provide the source code for the whole thing.  
Click on "See Attributes" or "See Methods", then scroll down. It shows you all the files you need to include.

On another note:
<img src="r3_c1_s1.png" alt="Dash Control 3!" onclick="CreateControl3Window()" />

should have parentheses at the end of the function name:
<img src="r3_c1_s1.png" alt="Dash Control 3!" onclick="CreateControl3Window()" />
0
 
LVL 82

Expert Comment

by:hielo
ID: 35135480
>>On another note:
>><img src="r3_c1_s1.png" alt="Dash Control 3!" onclick="CreateControl3Window()" />
I meant that your txt file  currently has:
<img src="r3_c1_s1.png" alt="Dash Control 3!" onclick="CreateControl3Window" />

but you need those parentheses.
0
 

Author Comment

by:lapucca
ID: 35135542
Great, I've corrected all that are mentioned here.  Just one more thing, I cannot find this file to download, <link type="text/css" href="js/jquery/themes/trontastic/jquery-ui.css" rel="stylesheet" />
This is indicated as one of the file needed on the web site I ref.  I was able to find the other include files.  thank you.
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35135582
Use this to create yourself a theme for jQuery:

http://jqueryui.com/themeroller/

-------------------------------------------------------
You can find me on: http://extremedev.blogspot.com
0
 

Author Closing Comment

by:lapucca
ID: 35135602
Thank you
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question