I'm working with an XML feed that I'm displaying using XSLT. Everything is working great except for 1 thing. One of the nodes that I'm using has a bunch of data in it that I need to split into separate divs for the design. jQuery should work wonderfully for it, but my problem is that in the data I'm supplied there is a string that *should* have a <p></p> around it, but it doesn't. So therefore I have no idea how to select it.[code]
I am working on code to wrap BBCodes around a user selection, then leave the selection selected for possibly adding more BBCodes around the same selection.My problem is that there seems to be several different ways to do it and I can't figure out which one is "the best".Now, I can't use the "standard" way of doing this because I am working with TinyMCE. I know there are countless examples on how to do this with textareas... that is NOT what I need.TinyMCE can give me a selection RANGE, a selection NODE or a selection OBJECT. Note that if I use TinyMCE's range, it internally "normalizes" the range to be a standard W3C range, regardless of browser.I've created a new range, extracted the selection from the user's range, created elements for the open and close BBCode, inserted the elements into the range and finally set the user's selection to the new range. Works fine.
I also tried taking the selection node (which is an element), then simply used "innerHTML" to add the opening and closing tags, then set the node to the modified node. Works fine.I've also used the editor's built in "selection.getContent()" and "selection.setContent()" calls and THIS also works.I've even tried using the DOM "surroundContents()" function, then used a regex to change the < and > into [ and ]. Freaky... but that works too.So, my dilemma is... which method should I use???To recap, here's what I want (blue represents selected text):
This is a test sentence. (user selected some text) This is a test sentence. (text is wrapped and remains selected). This is a test sentence. (user clicked another bbcode button).
I found this code on some web site which actually works on my current Safari browser. I will be grateful if anyone out there with IE version 8 or less can verify it working as well.
Basically I wanted to highlight some text with mouse drag, and have that piece of text wrapped with [high] at the beginning and [/high] at the end.
it seems the very first thing I try to dogives me problems. However, probably I am missing something so let meask you if you can hint me on the best way to accomplish this.I want to transform a document with a flat structure like this
Is there a way to stop superfish from wrapping? When there are too many menu items to fit on the page I don't want the menu to wrap. I would prefer to use the browsers scroll bars to see the rest of the menu.
I am building an e-learning lesson in Lectora that will be deployed to a SCROM compatible learning management system. The lesson is converted into HTML before that happens. My table of contents is around 100 pixels wide but some of the page names are longer than that and do not display fully when viewed in a browser.What I am trying to do is this:The page name for this page is very, very long and I can't see it all. Blah blahWould becomeThe page name for this page is very,
I've got a form with a textarea box, currently you can just type a message in the box and submit it, then it is added to a mysql database and shows up on a page I made for people to view staff memos.
I've been asked to add formatting options like bold, italic, underline etc. Unfortunately me and javascript have never really met so I'm quite stumped. I can handle the form processing with PHP converting [b] to <strong> etc myself but I need help with the actual user interface.
I have a (not too long) paragraph. In this paragraph a few words are wrapped with <span class="emphasize_m"> and <span class="emphasize_xl"> What i want to do is wrap all words in <span> which aren't wrapped already.Then i want to switch all span opacities to 0 (zero).I don't have an idea of how to wrap words separately.
I'm trying to dynamically turn textarea word wrapping on and off and have the textarea update accordingly but my code isn't working and I'm not sure why.
I've got an unordered lists. I need to make the numbers larger (ordered lists numbers) and keep the text in the list at the same size. So what I was assuming I need to do is make the <li> font-size larger (the size I want the unordered list number to be), then wrap the text with a <span> and make the <span> smaller. I'm using a CMS and since the client will be modifying the text in the CMS, I can't exactly tell them to put <span> text, blah, blah</span> in the unordered lists as they won't figure that out. So how would I write the jQuery to wrap the text in the unordered lists with a span? Currently the output is like so:
Let's say I have this paragraph..<p>My dog is brown.</p I would like to accomplish this.. <p>My <span class="animal">dog</span> is brown.</p> So, I want to use JavaScript to find all "dog" strings inside the paragraph and wrap them in a SPAN element of a given class. I would love to have a plug-in that does that... like this: $("p").findAndWrap("dog", "<span class='animal' />"); I know this can be done in JS, but I'm not particularlyexperiencedin JS string manipulation, so it would take a while until I would accomplish this...Is there a plug-in that does this?
I'm trying to 'wrap tags' around text in a text box.
<script language=javascript> function insertFauxTags(fauxTag, e, endFauxTag) { var e = document.frmAddNewForum.txtTopicMessage.selected; document.frmAddNewForum.txtTopicMessage.Value += fauxTag + e + endFauxTag; } </script>
<a href="javascript:insertFauxTags('[p]' + e + '[/p]')"><img src="http://www.<%=strSiteName%>/images/parabutton.gif" border="0" alt="Paragraph" /></a> When I run this in FF I get 'e' is not defined - any ideas?
A question for a jQuery expert. I'm more familiar with Prototype, but I've been using jQuery a lot recently and needed to find out how something is done, jQuery style Prototype has a rather handy wrap() function which lets you wrap an existing function within another function. It lets you attach code to be executed before or after an existing function is called.[URL]...
i have a menu generated by a list with nested lists. i want the parent link to stay highlighted when the mouse hovers over the sub menus. because those sub menus are also generated by jquery (qtip), CSS alone won't do it (triedul.topnav li:hover a {background-color: #F00;}).is there a way to do this using jquery?
All I want to do is to have a div slide down from underneath a button I have. When i search online, I find a zillion slide down menu scripts, but they don't work for just sliding a div.
I've copied some code from a book which will enable me to make a layer around a page, my aim is to do something a little more complex but this I thought would get me started.
Anyway, I've run into a problem before I even start! The script works OK, it runs the image in from the left hand side quite nicely, great. Problem I have it always scrolls up to the top of the page, when the link I click maybe 2 or 3 screens below (does that make sence?). I thought if I was to add a name attribute to the link I could get the co-ordinates of this and the screen will not reposition. Code:
My pages all have the same blank at start then the images slide up trick. I have an old workaround for IE that stopped working, and I don't know what to do. In IE now nothing shows up.