Hi,
How to find all the anchor tags inside a div tag and need to append one more property to the anchor tag. say target="_blank".
How can i do this in using jquery?
i have the following script
<select id="select1">
<option value="1">1day</option>
<option value="2">2day</option>
<option value="3">3day</option>
</select>
<select id="select2">
<option value="1">1day</option>
<option value="2">2day</option>
<option value="3">3day</option>
</select>
and jquery
$("#select2").change(function() {
var max_value = parseInt($("#select2 :selected").val());
var min_value = parseInt($("#select1 :selected").val());
if(max_value < min_value)
{
$("#select1").val($(this).val());
}
});
and now, what i can't understand anyway - if values of option elements are integer numbers, why i have to use parseInt()? in some cases it doesn't work without parseInt().
Thanks
how to delete the div using java script?
for details,
I have question div one by one, each question have up and down arrows, it have multiple div, and also have a save button, once i checked some question and press save button, the checked question are display blocked, others are none, In that time i click up and down arrows, it will moved included hided div also, so please help the same,
Thnks
I have a nested set of jQuery droppables...one outer droppable that encompasses most of the page and an a set of nested inner droppables on the page. The functionality I want is:
If a draggable is dropped outside of any of the inner droppables it should be accepted by the outer droppable.
If a draggable is dropped onto any of the inner droppables it should NOT be accepted by the outer droppable, regardless of whether the inner droppable accepts the draggable.
So that would be easy if I could guarantee 1+ inner droppables would accept the draggable, because the greedy attribute would make sure it would only get triggered once. Unfortunately the majority of the time the inner droppable will also reject the draggable, meaning the greedy option doesn't really help.
Summary: The basic functionality is a set of valid/invalid inner droppables to accept the draggable, but when you toss the draggable outside any of the draggables it gets destroyed by the outer droppable.
What's the best way of doing this?
When a user clicks a button I need to create a .bmp file on the server. After the .bmp file is created I will load it into the html page. Would Ajax be the best way to accomplish this?
Hi all!
jQuery.ready() allows us to wait for the construction of the webpage. Recently it has been added support to wait until CSS files are loaded.
I would like to know if that feature can be used for downloaded content, because I fetch content via $.ajax() that holds CSS references and I would like to retrieve the content of the CSS before working with the retrieved content.
Fetch with $.ajax() the html.
-- Wait until all CSS is downloaded.
Show to fetched content (already css'ed).
Thank you very much for your help.
I'm total noob with CSS and it looks like hell =/
I have absolute positioned DIV and I handle mouse events over this DIV with JS like this:
<div style='position: absolute; left: 0px; width:50px; height: 50px;'
onmouseover='this.style.border="2px solid red"'
onmouseout='this.style.border="1px solid black"'>
</div>
<div style='position: absolute;'>SOME TEXT</div>
I need to place some text over this DIV and over the few same DIVs, but if I place any element over this DIV onMouseOut event is firing when mouse cursor switch to text. Tag with text can't be inside the DIV. Playing with z-index didn`t help. My browser is IE8.
I have a FLASH object that I mouse over which in turn calls the following function to scroll a div. It works but due to the constant high speed scrolling it would throw up NULLS. This in turn caused IE to open a new page through my FLASH ActionScript 2.0
I found that by creating the SC variable and throwing in the condition "if it exists" keeps FLASH from causing IE to open a new page.
However, it still creates an error behind the scenes of "Object Required". Although my application works I do not want load up memory with errors.
Any thoughts?
var SC;
function pP(PT){
SC=document.getElementById('P'+PT).offsetTop;
if(SC){document.getElementById('CBOX').scrollTop=SC;}
}
Basically, I'm trying to implement a system that behaves similar to the reading pane that's built into the Google Reader interface.
If you haven't seen it, Google Reader presents each article in a separate box and as you scroll it highlights the current box (and marks the article as read). In addition to this, you can move forward or backward in the article list by clicking the previous and next buttons in the UI.
I've basically figured out how to do most of the functionality. However, I'm not sure how I can determine which of my divs is currently visible in in the scrollable pane.
I have a div that is set to overflow:auto. Inside of this div, there are other divs, each one containing a piece of content. I've used the following jquery plugin to make everything scroll based on a click of the "next" or "previous" button and it works like a charm:
http://demos.flesler.com/jquery/serialScroll/
But I can't tell which div has "focus" in the scrollable pane. I'd like to be able to do this for two reasons.
I'd like to highlight the item that the user is currently reading (similar to Google Reader). I need to do this regardless of whether or not they used the plugin to get there or used the browser's scroll bar.
I need to be able to tell the plugin which item has focus so that my call to scroll to the "next" pane actually uses the currently viewed pane (and not just the previous pane that the plugin scrolled from).
I've tried doing some searching but I can't seem to figure out a way to do this. I found lots of ways to scroll to a particular item, but I can't find a way to determine which element is visible in an overflowed div. If I can determine which items are visible, I can (probably) figure out the rest.
I'm using jquery if that helps. Thanks!
Hi stackoverflow! (first post!)
Ive been trying to get this problem solved, but I cant seem to figure it out without some serious workarounds.
if I have the following html code:
<ul>
<li class="parent"> headertext </li>
<li> text </li>
<li> text </li>
<li> text </li>
<li class="parent"> headertext </li>
<li> text </li>
<li> text </li>
</ul>
Now, how do I now just select the li's following the first parent (or second, for that matter)? Basically selecting an li with class=parent and the following siblings until it reaches another li with the parent class.
I could restructure the list with nested lists, but I dont want to do that.
Any suggestions?
I'm curious how I can create a DIV (or anything really) that I can fade (or change opacity of) when a user scrolls down the page. This DIV would sit at the top of the page, but only be clearly visible when at the very top of the page.
Additionally, it would be ideal if I I could have this element fade back in onmouseover, regardless of the current scrolled position on the page.
I have the following line of code which works well:
$("a.grouped_elements[href$=.jpg],a.grouped_elements[href$=.png],a.grouped_elements[href$=.gif]").fancybox();
Problem is, if the href is .JPG it doesn't work it only works with .jpg. How can I make the above case insensitive so either all caps or no caps or a mix all match for the file extension?
Thanks
http://gizmodo.com/5523721/microsoft-office-on-windows-phone-7-looks-fantastic
I was wondering if it was possible to obtain an effect similar to the windows 7 mobile examples above without using Flash. I would like to have content swivel in along the z-axis.
Thanks!
I'm using Firefox as my default browser and I'm trying to debug java script in side asp.net page visual studio 2008 with Firefox browser.
how to enable script debugging in visual studio 2008 when using Firefox?
In the example fiddle, how can I get the total number of markers displayed on the map? I'm pushing each of the markers into an array like this:
markers.push(marker)
And attempting to get the total number of markers like this:
$('.marker-count span').html(markers.length);
Unfortunately, "markers.length" is returning 0 when it should be returning at least 3.
I have example code here: http://jsfiddle.net/287C7/
How can I display the total number of markers? Is it not possible to add each marker to my array?
I need to know the amount of markers shown so that I can alert the user if there are none.
Thanks,
I have an optgroup like this:
<optgroup label="Eller välj Län" title="Eller välj Län" style="background-color:#FC9;">
<option value="Blekinge Län">Blekinge</option>
<option value="Dalarna Län">Dalarna</option>
<option value="Gotlands Län">Gotland</option>
</optgroup>
Problem is, only in Firefox, the class applies to all options inside the optgroup.
I need it to apply only to the optgroup label...
Any ideas why?
Thanks
Given the following text:
This is!!xa simple string!xpattern
I would like to get a regexp that matches the !x that's between "string" and "pattern" but not !!xa that's between "is" and "a".
This regexp is to be used inside a string split().
I have tried several combinations but I cannot get a regexp that meets my needs. Perhaps my expression is not so regular after all =)
Thanks in advance!
Using toogle to show/hide the div, I've got a problem that when I hide my div with anothor function, I have to click twice on the button to perform correct action.
Is there any way change the toggle switch like I clicked the button?
$('#add_task').toggle(function() {
if ($("#new_task_status").attr("value")==0) {
$("#new_task").slideDown();
$("#new_task_status").attr("value", "1");
}
}, function() {
if ($("#new_task_status").attr("value")==1) {
$("#new_task").slideUp();
$("#new_task_status").attr("value", "0");
}
});
$('nav').click(function() {
if ($("#new_task_status").attr("value")==1) {
$("#new_task_status").attr("value", "0");
$("#new_task").slideUp();
}
});
Hi All,
I have a div that contains many spans and each of those spans contains a single href.
Basically it's a tag cloud. What I'd like to do is have a textbox that filters the tag cloud on KeyUp event.
Any ideas or is this possible?
Thanks,
rodchar
I am new to developing sites and just started using wordpress. I was told that I could use fancybox to help create a popup that would allow a person to select a country. Something similar to below, the only problem is I have no clue how to do this, I installed a fancybox plugin in (http://wordpress.org/plugins/fancybox-for-wordpress/). The way the person did it was you click on an image and then this text country pops up. How do I implement this to pop up a country select after you click on an image? Thanks!
hello !
languages table(languagename,languagecode(pk),part);
parts table(subjectype,part(pk));
I want to access only perticular subject type into drop downs...
How can i do this.