@Mottie... (or anyone who first saw it). How do I add a class in the parent element only if the checkbox inside is checked. I want the .sortable element become yellow if checkbox is checked:
@Mottie... (or anyone who first saw it). This might be a bit tricky. But how can I remove the .sortable and input.remove then replace it with breakspace or paragraphs in the generated codes?
@Chris can do that on his CSS3 Button Maker. I don't know how to change html code into other code without changing the content.
// how can I write my wishes correctly? $('button#generate').click(function(){ var realContent = $('.sortable').html(); $(realContent).replaceAll('.sortable'); var thecode = $('#area').html(); $('#thecode').text(thecode); $('#thecode').dialog({show:"fade", hide:"explode"}); $('#area').html(''); });
I changed the code div to a textarea and added a bit of formatting... I originally had a "\t" in front of the LI's but it added too much indentation, so I switched it to two spaces.
Thank's for your help Mottie. I already get the point, on how to remove .sortable and how to add breakspace on the generated codes. It would be a good reference for me in the future :D
Hey... umm what do you mean by almost solved? And I'm not sure I understand what you mean by "when the elements dragged, the generated codes mess again!". I moved the elements around and the code seemed to be fine to me.
I hope that I can make Lorem Ipsum Generator with JQuery :p Until then and then I thought: "Does anyone want to add and subtract paragraphs then copy it while they can copy a paragraph with the classic way".
At that time I decided to add paragraphs, tables, headings and other inside <div id="area"> by default, so JQuery only serve to modification, not as a main actor in the generator. But when I add an element with my generator rules the elements that I put in it all messszzz!!! (only the <br /> tag), Whether I've inserted it correctly according to the rules in the generator. *sigh*
When I add a new paragraph, it looks exactly the same as the other ones already in there... which browser are you using? I just checked it on Firefox and Chrome.
I'm a perfectionist too (a lazy one really), but it sounds like you might be running into a css problem.
Actually I had that fixed way back about 10 versions ago, but it didn't get copied over or got removed in one of your updates. All it needed was the trim function seen below (demo)
Oh, that image. It is simply a banner image. Not a virus. I am a follower of that friendship communities. I'll try to get rid of it. But HERE IS NOTHING HAPPEN T_T
Ok, it's fine now... nice work, but I think it would be better to have it online instead of making people download the files. You know, at the top of the jsFiddle page is a Share button that has a link to a full page demo.
.sortableelement become yellow if checkbox is checked:http://jsfiddle.net/uH8Ez/
What checkbox? and what sortable?
>o<I want to ask another tomorrow. Today is a lot of work. Thank you very MUCH.
.sortableandinput.removethen replace it with breakspace or paragraphs in the generated codes?@Chris can do that on his CSS3 Button Maker. I don't know how to change html code into other code without changing the content.
Can it be done for the html code? Or not?
http://jsfiddle.net/tovic/3DMue/15/
I was thinking about Whiskas. Does Whiskas can make a person clever in JavaScript?
...
Then, how can I add
<br />in everyli,ul,ol,h1andp? So the code would be neater.http://jsfiddle.net/tovic/3DMue/20/
Try this (demo)I changed the code div to a textarea and added a bit of formatting... I originally had a "\t" in front of the LI's but it added too much indentation, so I switched it to two spaces.
T_T
Incredible!
http://jsfiddle.net/tovic/3DMue/23/
.sortableand how to add breakspace on the generated codes. It would be a good reference for me in the future :DUntil then and then I thought: "Does anyone want to add and subtract paragraphs then copy it while they can copy a paragraph with the classic way".
At that time I decided to add paragraphs, tables, headings and other inside
<div id="area">by default, so JQuery only serve to modification, not as a main actor in the generator. But when I add an element with my generator rules the elements that I put in it all messszzz!!! (only the<br />tag), Whether I've inserted it correctly according to the rules in the generator. *sigh*Merry Christmas
</p>of the original elements position are different with the inserted paragraph?PS: Am I too perfectionist?
http://jsfiddle.net/tovic/3DMue/27/
I'm a perfectionist too (a lazy one really), but it sounds like you might be running into a css problem.
In inserted paragraph, the generated code will look like this:
but in the default paragraph will look like this:
Actually I had that fixed way back about 10 versions ago, but it didn't get copied over or got removed in one of your updates. All it needed was the trim function seen below (demo)
I'll go find out about
.trim(). And will prepare the next question maybe :phttp://jsfiddle.net/tovic/3DMue/29/ (Click add ordered/unordered list!)
Try using
.live("click", function(){instead of.click(function(){, because the list items don't exist until you add them.$(this).parent().prev().remove();http://jsfiddle.net/tovic/3DMue/31/
Hey Mottie, Did you also feel that here's too many
.click()functions? Can I integrate them all in a bracket? For example like this:?????????????????????
$(this).parent().lengthpoints to the parent of the link, which is the LI. Try this (demo):Or this would work too, but a bit more messyIt uses.parent().parent()instead of.closest('ul,ol')since I'm not sure it works and I'm too lazy to test it.This will be the last question: How do I unwrap the
<span>from text? I've tried it but did not succeed:I add this code to increase the paragraph too:
Example: http://stackoverflow.com/questions/2308366/remove-element-with-jquery-but-leave-text
Lipsum-UI
getting all sorts of malware warningsa metaphore?How about now?
Also, since you're using jQuery UI, you might was to include the stylesheet - http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css - Just add it under the "Add Resources" tab.
EDIT: http://hompimpa.googlecode.com/svn/trunk/Lipsum-UI/index.html