Solved

Why my jQuery plugin isn't working?

Posted on 2011-03-14
9
268 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
  • 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now