Solved

Why my jQuery plugin isn't working?

Posted on 2011-03-14
9
270 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

776 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