My question today is involving the accordion. I would really like to get rid of the highlight when I click on the tab, but nothing I have done works so far. I'm not sure of what I should do... this is what I have so far.
I am currently building a rubric system, basically a <td> will have a set of rating option, with a radio button. so when a user clicks on td tag in a table, i want to only highlight the td and select a radio button its similar to irubric assessment rating system
I want to find a way to highlight elements when I click on them. The problem is the elements are nested and when I click on a child element, the parent element is highlighted as well. I would like the child to highlight only, but because the child is within the boundaries of the parent (i.e. you can't hover over the child without also hovering over the parent), the parent highlights as well.
I'd like to be able to hover over, click and highlight an <li> and hover over, click and highlight the <div> independently of one another. It's no problem to hover over, click and highlight the <div> without highlighting the <li>, but because the <div> encapsulates the <li> it's impossible to hover over, click and highlight the <li> without highlighting the <div>.
I'm trying to figure this out with jQuery: I have a few paragraphs of text kind of like this:
<p class="original" id="paragraph_1">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ut metus augue, vitae malesuada massa. Vestibulum nec lectus urna, vehicula porta leo. Fusce dui nunc, scelerisque at molestie ut, ultricies eu purus. Duis tristique placerat rhoncus. Aliquam rhoncus lacus justo. Morbi ultricies egestas orci eget fermentum. Proin sapien sem, suscipit vel semper in, tincidunt id enim. </p>
<p class="text" id="paragraph_2">Maecenas nisl ipsum, faucibus sed pulvinar a, tristique sed magna. Sed dui erat, tempor ut rhoncus sagittis, lacinia quis lorem. Quisque feugiat, ipsum nec varius elementum, est nunc lacinia mi, mollis convallis lorem ipsum at erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
And I have a couple of classes, like so: .highlight { background-color: #ccc; } .strikethrough { text-decoration: line-through; } What I want to do is apply the .highlight class to a sentence (not the entire paragraph) on hover, and apply the .strikethrough class to a sentence on click. It's easy to find a sentence using regex, but I don't know how to add/remove a span to just that particular sentence that is being hovered over. I know I could programatically wrap each sentence in <span>...</span> tags on the backend, but I was hoping there was a better solution.
I'm not good at JS, but want to get more about it.
I want to use a JSP (the java code just used to get date, the rest are html and javascript),
to display a table. the requirement is the all rows in even number in light-blue, rows in odd number in light gray, when a mouse clicks on a row, this row gets highlighted and in yellow, and it keeps highlighted until next row is clicked on; plus when a row gets click, the data on the row is saved to forward to (same as putting vales in input form then forward to action form).
I would like to write a script that will highlight any html element in a page (or maybe just divs) onclick, and print out the name of that element on the top of the screen somehow. I cannot make any major adjustments to this html, just insert a script because this will need to work for user submitted html pages
I have an HTML table with many rows and columns with each row containing info about one specific item and a delete link (there is a delete link for each row). What I want to do is to highlight the whole row (<tr> element) in the table (with a different background color) when I click on the delete link of that row (the new page opens in a new window.)
My question is: How do I highlight (by changing the bg color for the whole <tr> element or -if that's not possible- all of that row's <td> elements) the row if I have clicked the delete link in that row. I want the row to stay highlighted so that I would know what rows were deleted. I guess this'll require id-specific actions applied to the row <tr> or all of its cells with an onclick event in that rows delete link.
Am trying to highlight the linkbuttons on click to class name hover ,for these am defining the linkbuttons in Masterpages and calling the function from content page .But am facing below issue
Error:Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object
I have say 12 pics on a page, in 3 rows of 4. The rows of pics are there so that a choice can be made from each row and I'm using a function <script>
var highlight_color = '#FF0033'; function toggle_highlight(id) { var images = document.getElementsByTagName('img'); for (var i = 0; i < images.length; i++) { var image = images[i]; image.style.borderColor = image.id == id ? highlight_color : 'white'; } } </script>
to toggle a border colour change so that you can see what was chosen from each row. The function I have used is fine in that it works, but I can only choose one picture and have the border changed, then if I click on another row the first border that changed obviously changes back and the new selection is highlighted. I don't really know where to go from here.
I am doing donation script. Here is my script so far
<script type="text/javascript"> <!--// function chkDonation(){ var form = document.forms[0]; // FORM NAME OR PLACE IN FORMS COLLECTION //; var amount = form['OtherAmount']; // TARGETTED INPUT NAME ( OtherAmount ) //; amount.style.visibility = 'hidden'; for(var i=0, input=form.getElementsByTagName('input'); i<input.length; i++){ if(input[i].type.match(/radio/i) && input[i].name.match(/DonationAmount/i)){ if(input[i].value.match(/Other/i)){ input[i].onclick = function(){ amount.style.visibility = 'visible'; .....
I have pretty much completed my script but now what I want it to do is to add more forms/field when the "Other" radio button is selected. So when the Other button is checked, I want the script to display more fields/forms below. Only when the "other" button is selected. When "other" selected the script should display fields like "cheque", "cash", "Payment" etc.
I cant really figure this out, the only thing i could see messing it up is the javascript:void(0) inside the anchor link but since there is a double click function and a click, it should only be one click.I put autoOpen which i think is also causing it, but i did that so theuser can open it, close it, and open it again so the delay "double click" is saying for the first time initialize and then the second click is opening?? if so how do i get around this?
HERE IS MY JQUERY $(document).ready(function(){ $("#pro_edit_profile").hide();[code]....
There is a checkbox on a form page, when you check it, a div will become visible with some extra inputs needed for that situation. To simulate this click on the checkbox external, I use click(). With jquery files 1.4 and lower this works properly and like expected. When using jquery library 1.4.1 or higher, something does not seem to work properly. Sooooo, the code:
Somehow I managed to get this thing 'sort of' working with 1.4.1 or higher. But the code to accomplish this is absurd. See functioncheckTheBox4Plus() on line 8. It works :) but shouldn't.. Or is it the other way around?
The problem: The addClass does not affect the styling of #title. Firebug shows .error, but as an empty selector. And, BTW, is this an appropriate way to flag errors -- by adding or removing a class?
What I want to do specifically is add a CSS class to strings that start with an @ symbol. I can't seem to find any examples online and I haven't had enough experience with jquery to figure this out on my own.
I want it to highlight either the first word only, or just the line that the @ symbol is found on.
I have work thumbnails on one side (meals), ingredients on the other side, what I would like to do is:
1) If I hover over a meal, the ingredients used for that dish are highlighted on the left 2) If I hover over an ingredient, the dishes that used this ingredient are selected
I am just starting out in jQuery, can anyone give me some pointers.
I am trying to dynamically add an area to a map and hilight it on hover. I can accomplish this in the html code like this... <script> $(function(){ $('.map'}.maphilight(); }); </script> <map id="mapPoly"> <area id="poly" shape="polygon" coords="0,9,5,0,15,0,20,9,15,17,5,17" href="http://www..." class="{...}"/> </map>
I can add the area successfully with javascript like this... function AddArea(){ var element = document.createElement("area"); element.id="poly"; element.shape="polygon"; element.coords="0,9,5,0,15,0,20,9,15,17,5,17"; element.href="http://www..."; mapPoly.appendChild(element); }
The only thing I cannot figure out is how to add the "class" to the element which sets the properties for the highlighting. It will not allow me to do this, element.class="{fillColor:ff0000}".
I have spent the last week trying to figure out how to do the following: User types some text in a text box. The autocomplete queries a php script that returns JSON of matched values. I have got thedrop down list to show these values but I cannot for the life of me get the matched characters to turn bold. For example, if the user types in "rav" and my list contains:
RAVEN RAVE RAVEL
then I want it to appear as
RAVEN RAVE RAVEL
My current JS code is as follows (along with HTML):
Altough I'm using jQuery for some time, this is my first post here about an issue that I really got stuck with. Otherwise jQuery is really nice and simple to use.
Currently using jQuery's function loadContent(elementSelector, sourceURL) { $(""+elementSelector+"").load(""+sourceURL+""); } and href="javascript:loadContent('#content', 'page/home.html');"
to load some remote content into the main container. The problems is: i'm unable to find any working solution to highlight the current, active menu item (build as an <ul> and styled with external css), considering the main page isn't reloading - especially when i'm in no way able to understand JS at all.Would any of you have any idea how to mark the current menu item marked as active untill another one is chosen - and then repeat the function?
I've got quite a challenging problem (for me) with jQuery and highlighting a parent <li> from activating checkboxes.I've got a nested unordered list which contains checkboxes... Example HTML: