[jQuery] Re: JQuery sliding div issue

2009-09-30 Thread sneaks

i didnt test your code but if you say it works then i think you just
need a resize listener:

$(window).resize(function(){
 // do stuff
});

cheers
j



On Sep 30, 12:23 pm, jpearson311  wrote:
> Hi all.  JQuery noob here.  I'm building a site right now that has a
> left column navigation and the navigation is nested inside a div,
> which is nested inside a table cell (i.e., ).  I'm using JQuery to
> make it so when the user scrolls down the page, the div slides down
> smoothly and always stays at the top of the page.  I have this
> working just fine, but when I change resolutions (i.e., 1024x768), the
> div scrolls over the bottom of the page, which is what I don't want.
> How can I calculate in order for the div to know when it hast reached
> the bottom of the table cell?  I tried using outerHeight to calculate
> the height of the table cell and then subtracting the height of the
> div from it, but I'm clearly doing it wrong because it's still not
> working.  You can view the page I'm referring to 
> atwww.ts24.com/watersedge/overview.cfm.
> The JS code I'm using is below.  If anyone has any pointers, I'd
> really appreciate it.  Thanks!
>
> Jesse
>
> var name = "#scroller";
> var menu_top_limit = 0;
> var menu_bottom_limit = $('#holder > #scroller').outerHeight() - 560;
> var menu_top_margin     = -15;
> var menu_shift_duration = 500;
> var menuYloc = null;
> ///
> $(window).scroll(function()
> {
>         // Calculate the top offset, adding a limit
>         offset = menuYloc + $(document).scrollTop() + menu_top_margin;
>
>         // Limit the offset to 0 pixels...
>         // This keeps the menu within it's containing TD boundaries
>         if(offset < menu_top_limit){
>                 offset = menu_top_limit;
>
>         // Give it the PX for pixels:
>         offset += "px";
>         }
>
>         /*else if(offset > menu_bottom_limit){
>                 offset = menu_bottom_limit;
>
>                 offset += "px";
>         }*/
>
>         // Animate:
>         $(name).animate({top:offset},
> {duration:menu_shift_duration,queue:false});


[jQuery] Google map throwing exception

2009-09-30 Thread Mohd.Tareq
Hi All,

I am trying google map with JQuery Model window.

I have written some script to view google map with model window. Bellow
steps are

1 - Click on link, (onclick event I am calling a javascript function to show
google map with model window)

function showGoogleMap(id,lat,long){
   try{
map = new GMap2(document.getElementById("map"));
var point = new GLatLng(lat, long);  //default loaction to india
map.setCenter(point, 8);
map.addControl(new GMapTypeControl(1));
//map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl(200));

var marker = new GMarker(point);

map.addOverlay(marker);
map.setCenter(point, 4);
//marker.openInfoWindowHtml(address);
   }catch(e){
alert('Exception '+e);
   }
   $("#googleMap").modal();
}

2 - After occuring above function its giving exception
*a is null*
*function zh(a){for(var b;b=a.firstChild;){yh(b);a.removeChild(b)}}*
**
Any body have any Idea for this issue...

Plz help



   Regard
Mohammad.Tareque


[jQuery] Re: Hide row if empty

2009-09-30 Thread Wacko Jacko

Brilliant! I will try this and get back to you.Thanks for your time!

On Oct 1, 3:21 pm, Charlie Griefer  wrote:
> Assuming you can turn those id's into classes (where you have
> id="database")... you can do the following:
>
> $(document).ready(function(){
>     $('ul .database').each(function() {
>         if ($(this).text() == "") {
>             $(this).parent().hide();
>         }
>     });
>
> });
>
> On Wed, Sep 30, 2009 at 10:14 PM, Charlie Griefer 
>
>
> > wrote:
> > If you're working with server side data like that, couldn't you just write
> > a conditional in whatever language you're using (PHP, CF, ASP, etc) to not
> > display the  if no data?
>
> > Also, do you really mean to re-use "database" as an ID for multiple
> > elements?  ID's ought to be unique.
>
> > On Wed, Sep 30, 2009 at 9:43 PM, Wacko Jacko wrote:
>
> >> Hi All,
>
> >> If I had a list displaying data as follows:
>
> >> 
> >>     Label Here{content
> >> here if available from database}
> >>     Label Here{content
> >> here if available from database}
> >> 
>
> >> Could I hide the whole  if their is nothing
> >> available to show from the database in  ?
>
> >> Thanks in advance for your help
>
> >> Jack
>
> > --
> > Charlie Griefer
> >http://charlie.griefer.com/
>
> > I have failed as much as I have succeeded. But I love my life. I love my
> > wife. And I wish you my kind of success.
>
> --
> Charlie Grieferhttp://charlie.griefer.com/
>
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.


[jQuery] Re: Hide row if empty

2009-09-30 Thread Wacko Jacko

Hi Charlie,

Thanks for your reply. I am using Business Catalyst (SaaS, hosted
solution) so I can't do the php / ASP thang.

I was using those id's only for reference purposes in this thread.

Thanks.

On Oct 1, 3:14 pm, Charlie Griefer  wrote:
> If you're working with server side data like that, couldn't you just write a
> conditional in whatever language you're using (PHP, CF, ASP, etc) to not
> display the  if no data?
>
> Also, do you really mean to re-use "database" as an ID for multiple
> elements?  ID's ought to be unique.
>
> On Wed, Sep 30, 2009 at 9:43 PM, Wacko Jacko wrote:
>
>
>
>
>
> > Hi All,
>
> > If I had a list displaying data as follows:
>
> > 
> >     Label Here{content
> > here if available from database}
> >     Label Here{content
> > here if available from database}
> > 
>
> > Could I hide the whole  if their is nothing
> > available to show from the database in  ?
>
> > Thanks in advance for your help
>
> > Jack
>
> --
> Charlie Grieferhttp://charlie.griefer.com/
>
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.


[jQuery] Re: Hide row if empty

2009-09-30 Thread Charlie Griefer
Assuming you can turn those id's into classes (where you have
id="database")... you can do the following:

$(document).ready(function(){
$('ul .database').each(function() {
if ($(this).text() == "") {
$(this).parent().hide();
}
});
});

On Wed, Sep 30, 2009 at 10:14 PM, Charlie Griefer  wrote:

> If you're working with server side data like that, couldn't you just write
> a conditional in whatever language you're using (PHP, CF, ASP, etc) to not
> display the  if no data?
>
> Also, do you really mean to re-use "database" as an ID for multiple
> elements?  ID's ought to be unique.
>
>
> On Wed, Sep 30, 2009 at 9:43 PM, Wacko Jacko wrote:
>
>>
>> Hi All,
>>
>> If I had a list displaying data as follows:
>>
>> 
>> Label Here{content
>> here if available from database}
>> Label Here{content
>> here if available from database}
>> 
>>
>> Could I hide the whole  if their is nothing
>> available to show from the database in  ?
>>
>> Thanks in advance for your help
>>
>> Jack
>>
>>
>
>
> --
> Charlie Griefer
> http://charlie.griefer.com/
>
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.
>



-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: Hide row if empty

2009-09-30 Thread Charlie Griefer
If you're working with server side data like that, couldn't you just write a
conditional in whatever language you're using (PHP, CF, ASP, etc) to not
display the  if no data?

Also, do you really mean to re-use "database" as an ID for multiple
elements?  ID's ought to be unique.

On Wed, Sep 30, 2009 at 9:43 PM, Wacko Jacko wrote:

>
> Hi All,
>
> If I had a list displaying data as follows:
>
> 
> Label Here{content
> here if available from database}
> Label Here{content
> here if available from database}
> 
>
> Could I hide the whole  if their is nothing
> available to show from the database in  ?
>
> Thanks in advance for your help
>
> Jack
>
>


-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: fadein is not a function?

2009-09-30 Thread jessie

No its ok,,,

Please understand, this is my 3rd day at looking at jQuery... no
previous javascript knowledge / or programming,

Only a noob at css and html. have been self teaching myself for 1
year.

Jess :)

On Oct 1, 3:05 pm, Dhruva Sagar  wrote:
> Np, it happens to everyone, sorry for being a bit harsh :).
> Thanks & Regards,
> Dhruva Sagar.
>
> Ogden Nash   -
> "The trouble with a kitten is that when it grows up, it's always a cat."
>
> On Thu, Oct 1, 2009 at 10:09 AM, jessie  wrote:
>
> > Yes thank-you... after i posted i had a look.
>
> > I guess looking at this type of *new code* has boggled up my eyes ;-)
>
> > On Oct 1, 2:36 pm, Dhruva Sagar  wrote:
> > > Did you even look at jQuery's site ?the function is fadeIn with a capital
> > > 'I'
>
> > > example : $("selector").fadeIn("slow");
>
> > > Thanks & Regards,
> > > Dhruva Sagar.
>
> > > Joan Crawford<
> >http://www.brainyquote.com/quotes/authors/j/joan_crawford.html>
> > > - "I, Joan Crawford, I believe in the dollar. Everything I earn, I
> > > spend."
>
> > > On Thu, Oct 1, 2009 at 10:02 AM, jessie  wrote:
>
> > > > Hi
>
> > > > I'm doing some online tutorials and simple tasks
>
> > > > I'm getting an error on the function .fadein
>
> > > > can someone please tell me what is wrong with this code.
>
> > > > $(function() { // document is ready for load
> > > >                   $('a').click(function() {
> > > >                        $('.box').fadein(5000);
>
> > > >                         });
> > > > });
>
> > > > Here is the inline style and markup
> > > > 
> > > > .box { background-color:blue; width:200px; height:200px; }
> > > > 
>
> > > > 
> > > > Click my link
>
> > > > Thanks
> > > > Much appreciated.
> > > > Jess


[jQuery] Re: How to link the JQuery

2009-09-30 Thread Charlie Griefer
No worries.  Send me a NJ pizza.  I haven't had good pizza since I left NJ
:)

On Wed, Sep 30, 2009 at 8:13 PM, Glen_H  wrote:

>
> Thanks again!
>
> Thanks from Central jersey too! I saw on your site your home grown
> Jersey, Good stuff.
>
>
> Take it easy man.
>
> Glen
>
> On Sep 30, 11:05 pm, Charlie Griefer 
> wrote:
> > As with including an external .js file, including an external .css file
> is
> > not functionally different than including it on the page.  The included
> css
> > will affect any applicable element(s) on the page.
> >
> > When you manipulate an element's CSS with jQuery, you're just
> manipulating
> > the CSS of that specific element.
> >
> > In short, no.  There's nothing special you need to do.  jQuery doesn't
> > technically access or touch the .css file.  It applies a particular style
> to
> > an element.  Whether that element "knows" that style depends on whether
> or
> > not the style is defined (either inline via 

[jQuery] Re: fadein is not a function?

2009-09-30 Thread Dhruva Sagar
Np, it happens to everyone, sorry for being a bit harsh :).
Thanks & Regards,
Dhruva Sagar.


Ogden Nash   -
"The trouble with a kitten is that when it grows up, it's always a cat."

On Thu, Oct 1, 2009 at 10:09 AM, jessie  wrote:

>
> Yes thank-you... after i posted i had a look.
>
> I guess looking at this type of *new code* has boggled up my eyes ;-)
>
> On Oct 1, 2:36 pm, Dhruva Sagar  wrote:
> > Did you even look at jQuery's site ?the function is fadeIn with a capital
> > 'I'
> >
> > example : $("selector").fadeIn("slow");
> >
> > Thanks & Regards,
> > Dhruva Sagar.
> >
> > Joan Crawford<
> http://www.brainyquote.com/quotes/authors/j/joan_crawford.html>
> > - "I, Joan Crawford, I believe in the dollar. Everything I earn, I
> > spend."
> >
> > On Thu, Oct 1, 2009 at 10:02 AM, jessie  wrote:
> >
> > > Hi
> >
> > > I'm doing some online tutorials and simple tasks
> >
> > > I'm getting an error on the function .fadein
> >
> > > can someone please tell me what is wrong with this code.
> >
> > > $(function() { // document is ready for load
> > >   $('a').click(function() {
> > >$('.box').fadein(5000);
> >
> > > });
> > > });
> >
> > > Here is the inline style and markup
> > > 
> > > .box { background-color:blue; width:200px; height:200px; }
> > > 
> >
> > > 
> > > Click my link
> >
> > > Thanks
> > > Much appreciated.
> > > Jess
>


[jQuery] Re: Tablesorter problems

2009-09-30 Thread Mike

Is there no one that can help?

On Sep 30, 4:26 pm, Mike  wrote:
> Hi I have recently come across the tablesorter 2.0 for jquery and have
> decided to use it on my website.  I have the examples to work etc.
> however I would like to exclude the first column of my table from
> being sorted and just to remain static irrespect of the other columns
> being sortable.
>
> I have found this 
> :http://stackoverflow.com/questions/437290/exclude-a-column-from-being...
> which is exactly what I needed however when pasting it into my test
> web page I get line 16 parse error (missing before statement).
>
> I have no previous experience of knowledge of jQuery so I would
> appreciate if someone could look at my test page and see what the
> problem is:http://www.freebetsextra.co.uk/tablesorter/tests/freebet3.html.
>
> This is the widget I am trying to use:
>
> $(function() {
>     // add new widget called indexFirstColumn
>     $.tablesorter.addWidget({
>         // give the widget a id
>         id: "indexFirstColumn",
>         // format is called when the on init and when a sorting has
> finished
>         format: function(table) {
>                 // loop all tr elements and set the value for the
> first column
>                 for(var i=0; i < table.tBodies[0].rows.length; i++) {
>                         $("tbody tr:eq(" + (i - 1) + ")
> td:first",table).html(i);
>                 }
>         }
>     });
>
>     $("table").tablesorter({
>         widgets: ['zebra','indexFirstColumn']
>     });
>
>
>
> });


[jQuery] Callback Function > had a look but don't get it

2009-09-30 Thread jessie

Ok i'm nearly there LOL

i have the link and a box which i want to foundOut as my function.

All works dandy now :)

But whatif i wanted after i clicked on the link to go to its normal
state?

Well i went to the jquery site but i don't think its designed for TRUE
beginners like myself

It talks about Callback function and its displayed like this

function callback() {
  this; // dom element
}

So here is my code and where do i put this callBack? and do i need to
add a class to it?
$(function() { // document is ready for load
   $('a').click(function() {
 $('.box').fadeOut("slow");


   });
});

Jessie


[jQuery] Hide row if empty

2009-09-30 Thread Wacko Jacko

Hi All,

If I had a list displaying data as follows:


 Label Here{content
here if available from database}
 Label Here{content
here if available from database}


Could I hide the whole  if their is nothing
available to show from the database in  ?

Thanks in advance for your help

Jack



[jQuery] Re: fadein is not a function?

2009-09-30 Thread jessie

Yes thank-you... after i posted i had a look.

I guess looking at this type of *new code* has boggled up my eyes ;-)

On Oct 1, 2:36 pm, Dhruva Sagar  wrote:
> Did you even look at jQuery's site ?the function is fadeIn with a capital
> 'I'
>
> example : $("selector").fadeIn("slow");
>
> Thanks & Regards,
> Dhruva Sagar.
>
> Joan Crawford
> - "I, Joan Crawford, I believe in the dollar. Everything I earn, I
> spend."
>
> On Thu, Oct 1, 2009 at 10:02 AM, jessie  wrote:
>
> > Hi
>
> > I'm doing some online tutorials and simple tasks
>
> > I'm getting an error on the function .fadein
>
> > can someone please tell me what is wrong with this code.
>
> > $(function() { // document is ready for load
> >                   $('a').click(function() {
> >                        $('.box').fadein(5000);
>
> >                         });
> > });
>
> > Here is the inline style and markup
> > 
> > .box { background-color:blue; width:200px; height:200px; }
> > 
>
> > 
> > Click my link
>
> > Thanks
> > Much appreciated.
> > Jess


[jQuery] Re: fadein is not a function?

2009-09-30 Thread Dhruva Sagar
Did you even look at jQuery's site ?the function is fadeIn with a capital
'I'

example : $("selector").fadeIn("slow");

Thanks & Regards,
Dhruva Sagar.


Joan Crawford
- "I, Joan Crawford, I believe in the dollar. Everything I earn, I
spend."

On Thu, Oct 1, 2009 at 10:02 AM, jessie  wrote:

>
> Hi
>
> I'm doing some online tutorials and simple tasks
>
> I'm getting an error on the function .fadein
>
> can someone please tell me what is wrong with this code.
>
> $(function() { // document is ready for load
>   $('a').click(function() {
>$('.box').fadein(5000);
>
> });
> });
>
>
> Here is the inline style and markup
> 
> .box { background-color:blue; width:200px; height:200px; }
> 
>
> 
> Click my link
>
>
> Thanks
> Much appreciated.
> Jess


[jQuery] fadein is not a function?

2009-09-30 Thread jessie

Hi

I'm doing some online tutorials and simple tasks

I'm getting an error on the function .fadein

can someone please tell me what is wrong with this code.

$(function() { // document is ready for load
   $('a').click(function() {
$('.box').fadein(5000);

 });
});


Here is the inline style and markup

.box { background-color:blue; width:200px; height:200px; }



Click my link


Thanks
Much appreciated.
Jess


[jQuery] Re: Trying to match just the first descendent in each tree of descendents

2009-09-30 Thread Charlie





$(".widget > .widget")  // stops at first desendant

$(".widget .widget : first") //might work too, haven't tried it

Andrew Ingram wrote:

  Apologies for the subject line, I'm struggling to explain the problem
in a concise manner.

I have the following document:


		Page Title Goes Here

		
			
Section Heading




		Section Title
		Content…
		



		Section Title
		Content…
		



			
		


	

I am trying to recursively access each element with the attribute
'widget'. The first level of recursion is easy:

$('[widget]:not([widget] [widget])')

Which matches all widgets that are not descendants of other widgets,
ie the top level.

The problem is with the next recursive steps, I can't figure out how
to find just the first level of widgets that are a descendents of the
current node.

$('[widget]:not([widget] [widget])').each(function(i){

   // For example, I need a query I'd put here to access the next
level of elements.

});

There is no guarantee that the widgets would be direct children of
each other, or that they'd be on the same tree level as their
'sibling' widgets.

Basically I need a way of finding all widgets that are descendents of
the current working node, but with no other widgets in-between.

If anything needs clarifying let me know.

Regards,
Andrew Ingram

  






[jQuery] Re: How to link the JQuery

2009-09-30 Thread Glen_H

Thanks again!

Thanks from Central jersey too! I saw on your site your home grown
Jersey, Good stuff.


Take it easy man.

Glen

On Sep 30, 11:05 pm, Charlie Griefer 
wrote:
> As with including an external .js file, including an external .css file is
> not functionally different than including it on the page.  The included css
> will affect any applicable element(s) on the page.
>
> When you manipulate an element's CSS with jQuery, you're just manipulating
> the CSS of that specific element.
>
> In short, no.  There's nothing special you need to do.  jQuery doesn't
> technically access or touch the .css file.  It applies a particular style to
> an element.  Whether that element "knows" that style depends on whether or
> not the style is defined (either inline via 

[jQuery] Re: [superfish] How to focus on clicked menu item after menu item is clicked with jQuery ?

2009-09-30 Thread Charlie





not sure exactly what you are trying to do but using jQuery addClass()
you can create a different css class for anything you click on

Tharindu Madushanka wrote:

  Hi,

I am new to jQuery and using superfish popup menu widget to create a
menubar. I have only four menus and 3 of them are not drop downs. So I
want to focus on the clicked menu item. How could I use jquery or some
other technique to do this. Kindly help me to solve this.

Thank you,
Tharindu Madushanka
tharindufit.wordpress.com

  






[jQuery] Re: How to link the JQuery

2009-09-30 Thread Charlie Griefer
As with including an external .js file, including an external .css file is
not functionally different than including it on the page.  The included css
will affect any applicable element(s) on the page.

When you manipulate an element's CSS with jQuery, you're just manipulating
the CSS of that specific element.

In short, no.  There's nothing special you need to do.  jQuery doesn't
technically access or touch the .css file.  It applies a particular style to
an element.  Whether that element "knows" that style depends on whether or
not the style is defined (either inline via 

[jQuery] Re: Superfish navbar alignment question

2009-09-30 Thread Charlie





you could do that with out using navbar option, set sub li's inline and
remove sub ul width, not tested but should be fairly straightforward

Vali wrote:

  Hello,

Actually I will repeat a message sent by some other user, message
which seems to have been completely ignored. I believe this is a good
question, I am also very interested in its answer (otherwise
unfortunately I will have to look to some other navbar system).

So, is it possible to align the dropped down nav to the corresponding
parent like it does in the basic mode? Right now the dropped down nav
stays aligned to the left for each 'current' list. I think a config
option could be made available for that purpose.

Regards,
Vali

  






[jQuery] Re: Modal Dialog with a datepicker inside, works one time, then never...

2009-09-30 Thread Alex Barrios

2009/9/30 Nalum :
>
> Hello Alex,
> The only reason it would be a problem is if you don't apply the jQuery
> to the input every time it is loaded or if it is loaded a second time
> and old input is still on the page then you have two elements with the
> same id.
>
> If you have two elements with the same id jQuery wont do anything as
> it expects that an id is unique.
>
> Nalum
>

Well after some testing i change the ID for a Class, a unique class
and now works perfect :-D

Problem solved ...

Thanks again! Cheers!! :D

-- 
Alex Barrios


[jQuery] Re: How to link the JQuery

2009-09-30 Thread Glen_H

Charlie, thanks for the feedback. A million times thank you! that is
exactly what I was looking for.

One other question I have is altering CSS using .css in Jquery, will
that auto select any linked css files or will I have to further
develop the jquery code to further direct it? I ask becuse well, im
new, but the tutorial I used just used .css and acted like that was
all that was needed.

again, thanks for your help Charlie!

On Sep 30, 10:48 pm, Charlie Griefer 
wrote:
> in your main page...
>
> you link to jquery.js:
>
> 
>
> Then you can either write inline javascript under that...
>
> 
>      $(document).ready(function() {
>           alert("I am ready");
>      });
> 
>
> ... or you simply link to other external scripts:
>
> 
>
> ...as many times as you need to.
>
>  src="/my/path/to/myOtherExternalJS.js">
>
> There's no functional difference between using an external .js file or
> putting your JS in the page itself.  Arguably, it's easier to maintain if
> it's well-organized in included files... but functionally no different.
> Well, there's the advantage of the .js file being cached in the browser in
> subsequent page requests... but other than that, functionally no different
> :)
>
> Understand that doing  is
> essentially including the .js on that page.
>
> The only thing to bear in mind is that the files will load in the order
> they're specified.  So make sure your include to the jQuery file is first.
>
>
>
> On Wed, Sep 30, 2009 at 6:46 PM, Glen_H  wrote:
>
> > I am confused as to how to link an external JQuery file to my web
> > page. I understand using . My question is regarding
> > the file I downloaded from Jquery.com. Do I add code to that file and
> > link it, or do I link that file and then create a new file with
> > javascript in it and link that as well?
>
> > Do I create a javascript file and somehow link the Jquery file to that
> > javascript file?
>
> > I guess I would need a step by step walkthrough on how to set up
> > Jquery using all external files.
>
> > thanks in advance guys
>
> --
> Charlie Grieferhttp://charlie.griefer.com/
>
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.


[jQuery] Re: How to link the JQuery

2009-09-30 Thread Charlie Griefer
in your main page...

you link to jquery.js:



Then you can either write inline javascript under that...


 $(document).ready(function() {
  alert("I am ready");
 });


... or you simply link to other external scripts:



...as many times as you need to.



There's no functional difference between using an external .js file or
putting your JS in the page itself.  Arguably, it's easier to maintain if
it's well-organized in included files... but functionally no different.
Well, there's the advantage of the .js file being cached in the browser in
subsequent page requests... but other than that, functionally no different
:)

Understand that doing  is
essentially including the .js on that page.

The only thing to bear in mind is that the files will load in the order
they're specified.  So make sure your include to the jQuery file is first.



On Wed, Sep 30, 2009 at 6:46 PM, Glen_H  wrote:

>
> I am confused as to how to link an external JQuery file to my web
> page. I understand using . My question is regarding
> the file I downloaded from Jquery.com. Do I add code to that file and
> link it, or do I link that file and then create a new file with
> javascript in it and link that as well?
>
> Do I create a javascript file and somehow link the Jquery file to that
> javascript file?
>
>
> I guess I would need a step by step walkthrough on how to set up
> Jquery using all external files.
>
>
> thanks in advance guys
>



-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: Really struggling pls help

2009-09-30 Thread jessie

Hi James

Thanks so much for replying to my desperate request for help! LOL

Well somehow i managed to work

This is what i've done.
jQuery(function($) {

function getLeaf(url) {
var splited=url.split('?');// remove all the parameter from url
url=splited[0];
return url.substring(url.lastIndexOf("/")+1);// return file name
without domain and path
}

jQuery.fn.extend({
 enter: function() {//plugins creation
 return this.each(function() {
   var pth = $(this).find("img")[0];
  //alert($(this).children().attr("href"));
   if($(this).children().attr("href")==getLeaf
(document.location.href)){// check that the link url and document url
is same
   $(pth).attr("src",pth.src.replace(/.gif/g, '_active.gif'));
   } else{
   $(this).hover(function(){
  $(pth).attr("src",pth.src.replace(/.gif/g,
'_active.gif'));// mouse over Image
  },function(){
  $(pth).attr("src",pth.src.replace(/_active.gif/
g, '.gif'));// mouse out image
  });
   }
   });
 }
});
$(function(){  // Document is ready
 $(".LPButton").enter();// call the function
});

$('input[type="image"]').hover(
function () { $(this).attr("src", $(this).attr("src").split('-
off').join('-on')); },
function () { $(this).attr("src", $(this).attr("src").split('-
on').join('-off')); }
);


});


My problemo now is that i would like to get rid of the src="full url
to the image" and just have src="folder/image/button/myimage" for the
input buttons

This is what i have now.


instead i'd like to have it like this...


Is that possible?

I'm going through some online video tutorials to get me started
also :)

J.



On Oct 1, 11:06 am, James  wrote:
> I'm still unsure what you want to achieve.
>
> To select the  tag, in place of:
> $('input[type="image"]')
>
> you can use:
> $(".LPButton")
>
> assuming that all relevant tags to want to work on will have the
> class="LPButton".
>
> That's as far as I know. I'm not clear on what you want to do with it.
> (There's no image src on a  tag, so it's not that..)
> Or is it that you want to roll over a text link and have another image
> do the hover effect?
>
> On Sep 30, 2:07 pm, jessie  wrote:
>
> > Hi All
>
> > Please be gentle with me!
>
> > Ok, its been 5 days that i'm trying to understand jQuery.  I cannot
> > get my head around it for the life of me! i'm no programmer and have
> > had no experience with JS.  I've started developing websites only 1 yr
> > ago and i came across jQuery when i wanted to do an accordian menu and
> > some image replacements for my buttons.
> > But, aghhh let me tell you i'm absolutely going mad! i have
> > Dreamweaver CS3, i've downloaded the plugin for jsQuery and i still
> > don't get what i'm looking at.  Had a look at a *beginners tutorial on
> > utube* and it looked fairly simple what he did and how he explained
> > it. Except where to from there!  I'm running an ecommerce store
> > which is based on php and is using prototype library for one of the
> > lightboxes.  So i've figured out that i need to do this for it to work
> > with both libraries.
>
> >  > script>
> >