Well it seems as if you can't override values with null as options. Is this
expected behaviour?
meeboo wrote:
>
> Hi all
>
> I have a plugin which has a couple of variables which can be overriden
> like this:
> $.fn.doStuff.defaults.classOdd = 'oddClass';
Hey all
How can I when dynamically adding a new element also bind a click event to
another element which removes it?
//Here's what I have so far, redundant code is omitted
$.fn.addElement = function(options)
{
//Redundant code omitted
this.prepend($elementToAdd); //dynamically create
Problem solved by cloning the element which is to be added, like this.
$("#adder").click(function()
{
var $elementToBeAdded = $('#content').clone();
$('#container').prepend($elementToBeAdded);
});
easy peasy
meeboo wrote:
>
> Hey all
&g
Solved it, it seems as if prepend moves the element instead of copying it. So
when trying to add the element a second time you just end up moving the
element to the exact position it's located.
meeboo wrote:
>
> Hey all
>
> In this example, how come I can't prepend th
Hey all
In this example, how come I can't prepend the paragraph to the div more than
once?
$("#adder").click(function()
{
$('#container').prepend($('#content'));
});
# Add content
content
--
View this message in context:
http://www.nabble.com/Dynamically-prepending-elements-to-a-d
Just what I needed. Thanks!
Francesco Vivoli wrote:
>
> Hi all
>
> I've just wrote about a simple wrap-up plugin of the idea given in
> http://www.nabble.com/RSS-Feed-Reader-to4997503s27240.html this post .
>
> it basically fills a news box with the contents of an rss feed.
> In case someone
Hey all!
I'm wondering why the following code will toggle the div 'divRed' to a
different color, but it won't toggle the color for 'divGreen'.
div {height: 100px; width: 100px;}
.divRed {background-color: red;}
.divGray {background-color: gray;}
.divGreen {ba
7 matches
Mail list logo