Re: re[jQuery] moveAttr('href') on document load?

2009-05-03 Thread Sam Granger


Thanks Charlie! That did the trick :)

Charlie Tomlinson wrote:
> 
> 
> 
> 
> 
> 
> 
> removeAttr() will take the whole href property out of the tag 
> 
> <a href="something.php"> Test</a> will become <a>
> Test</a> 
> 
> if you want to keep href property you could overwrite the href values 
> 
> $('#add a').attr('href','#'); produces 
> 
> <a href="#"> Test</a> 
> 
> 
> 
> Sam Granger wrote:
> 
>   
>   $(function() {
>   $('#add a').removeAttr('href');
>   });
> 
> What's wrong with this code? I want to remove all href's from a tags
> onload
> of a document. Still a bit new to jQuery so sorry for this silly question!
> Just been trying to figure it out for ages. The links are in a div with id
> add.
> 
> Thanks for all the help!
> 
> Sam
>   
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/removeAttr%28%27href%27%29-on-document-load--tp23355653s27240p23358784.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: re[jQuery] moveAttr('href') on document load?

2009-05-03 Thread Sam Granger


Awesome, thanks! That works exactly how I want it!:)
-- 
View this message in context: 
http://www.nabble.com/removeAttr%28%27href%27%29-on-document-load--tp23355653s27240p23358695.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



re[jQuery] moveAttr('href') on document load?

2009-05-03 Thread Sam Granger


$(function() {
$('#add a').removeAttr('href');
});

What's wrong with this code? I want to remove all href's from a tags onload
of a document. Still a bit new to jQuery so sorry for this silly question!
Just been trying to figure it out for ages. The links are in a div with id
add.

Thanks for all the help!

Sam
-- 
View this message in context: 
http://www.nabble.com/removeAttr%28%27href%27%29-on-document-load--tp23355653s27240p23355653.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Cookie issue - path?

2007-12-21 Thread Sam Granger


I have a draggable menu which remembers its position using a cookie. I want
to use this menu all over my site and just use the 1 cookie to read from. It
works at first if I drag the menu on the main page and go to a subpage but
when I move it on the subpage it appears a new cookie is made with a new
path. However I am only using the code below:


$().ready(function() {
$('#sidebar').draggable({
handle: 'div#logo',
opacity: 0.8,
zIndex: 50,
stop: function() {
var y = $('#sidebar').css('top');
var x = $('#sidebar').css('left');
jQuery.cookie('menu_position', x+','+y, 20, { expires: 
7, path: '/',
domain: 'intrellia.com', secure: true });


}
});
var pos = jQuery.cookie('menu_position').split(',');
$('#sidebar').css({ position: 'absolute', top:pos[1], left:pos[0] });
});


What am I missing? Thanks!
-- 
View this message in context: 
http://www.nabble.com/Cookie-issue---path--tp14456821s27240p14456821.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Cookie issue - path?

2007-12-21 Thread Sam Granger

I have a draggable menu which remembers its position using a cookie. I
want to use this menu all over my site and just use the 1 cookie to
read from. It works at first if I drag the menu on the main page and
go to a subpage but when I move it on the subpage it appears a new
cookie is made with a new path. However I am only using the code
below:


$().ready(function() {
$('#sidebar').draggable({
handle: 'div#logo',
opacity: 0.8,
zIndex: 50,
stop: function() {
var y = $('#sidebar').css('top');
var x = $('#sidebar').css('left');
jQuery.cookie('menu_position', x+','+y, 20,
{ expires: 7, path: '/', domain: 'intrellia.com', secure: true });


}
});
var pos = jQuery.cookie('menu_position').split(',');
$('#sidebar').css({ position: 'absolute', top:pos[1],
left:pos[0] });
});


What am I missing? Thanks!