I use jquery.hover to toggle a class when someone mouses over a link. On the iphone when someone taps the link, it toggles the class on, but it doesn't ever toggle the class off until they tap somewhere else.
Hi all, i have a set of php function that i want to call on different events mostly onclick with jquery async (ajax).
The first function is called on load
$(document).ready(function()
{
$("#div2").hide('slow');
$("#div1").empty().html('<img src="ajax-loader.gif" />');
$.ajax(
{
type: "POST",
url: "WebFunctions.php",
data: {'func':'1'},
success: function(html)
{
$("#div1").show('slow').html(html)
}
});
The Data: {'func':'1'} -- is a switch statement on the php side
switch($_POST['func'])
{
case '1':
getParents();
break;
case '2':
getChilds(params);
break;
case '3':
getChildObjects(params);
break;
default:
}
"This functions are calls to a soap server" <-- irrelevant.
So when that function finishes i get an array which contains IDs and Names. I echo the names but i want the ID for reference so when i click on the echoed name i can call an other php function with parameter the ID of the name...
How do i get rid of the switch statement?? How do i call properly php functions and pass params to it??? How can i save this IDs so when i click on an item with that id an other php function is called??
Plz feel free to ask any question, any answer is welcome :)
I have a contenteditable element that I want to focus, but only insofar as to place the cursor at the front of the element, rather selecting everything.
elem.trigger('focus'); with jquery selects the entire element in chrome. How can I get it to behave the way I want, or is focus perhaps not what I'm looking for.
Thanks
I have an HTML table having n rows and each rows contain one radiobutton in the Row.Using jQuery , How can i look thru these radio buttons to check which one is checked ?
I am looking for a good jquery pagination plugin to use in my aspx page....
I have the following parameters
StartPage,TotalRecords,NumberofPages... I would like my plugin to same as stackoverflow paging ....
Im doing some form validation on a website and I've tried to use JQuery Validator and it works find but isn't valid as it uses custom attributes. I've tried every which way to make it valid but it seems besides some other custom javascript, which is not an option, it isn't valid.
Has anyone come across one that is valid? Or some other way to make it valid? I've tried custom dtds, adding the attribute to the doctype but that leaves a ] on the page.
Cheers
Im using the following function to hide a series of forms on a page:
$('.ask').toggle(function() {
$(this).text('-').next('.addtitle').slideDown('fast');
}, function() {
$(this).text('+').next('.addtitle').slideUp('fast');
});
There can be anything from 0 to 5 forms on the page all with the class .ask
What I want to be able to do is to select one form NOT to hide, so the jQuery needs to hide all put one of the forms on the page randomly.
How can I achieve this?
What I want to do is add and remove list items. I have got it to add new items to the list and I can remove existing ones but not the ones that have been added. It seem like it would work but it doesn't. Any help would be appreciated! Here the code:
JQuery:
<script type="text/javascript">
$(function(){
$('a#add').click(function(){
$('<li><a href="#" id="remove">--</a>List item</li>').appendTo('ul#list');
});
$('a#remove').click(function(){
$(this).parent().remove();
});
});
</script>
HTML:
<a href="#" id="add">Add List Item</a>
<ul id="list">
<li><a href="#" id="remove">--</a> List item</li>
<li><a href="#" id="remove">--</a> List item</li>
<li><a href="#" id="remove">--</a> List item</li>
<li><a href="#" id="remove">--</a> List item</li>
</ul>
Is there a way to hide a form from my users until they click a link and then the form drops down for the user to fill out, by using PHP or JQuery if so how? Is there a tutorial that will teach me how to do this?
I have a menu div to put the menu list inside
<!--menu-->
<a href="#"><div id="menu-tab">Menu</div></a>
<div id="menu">
<ul>
<li><a href="#">a</a></li>
<li><a href="#">b</a></li>
<li><a href="#">c</li>
</ul>
</div>
for the css
#menu {
width: 220px;
border: 2px solid #004990;
float: right;
margin-right: 15px;
margin-top: -52px;
}
here is the javascript/jquery
$('#menu-tab').click(function(){
$("#menu").slideToggle("normal");
});
becuase margin-top: -52px;(which I control the menu position in the page), therefore each time when I click the menu tab, the #menu will slide from -52px. how can I let it slide from 0px?
How do I test to see if links are external or internal? Please note:
I cannot hard code the local domain.
I cannot test for "http". I could just as easily be linking to my own site with an http absolute link.
I want to use jQuery / javascript, not css.
I suspect the answer lies somewhere in location.href, but the solution evades me.
Thanks!
Hi I am using some modified code from another post. Basically I want to switch between showing 10 rows of a table to showing all rows (50 for example). I have got it to show from 10 rows to all, however what I need to do now is code it so that if I click the div again it toggles or resets back to showing 10 rows.
<script type="text/javascript">
var numShown = 10; // Initial rows shown & index
var numRows = $('tbody').find('tr').length;
var numLeft = numRows - numShown;
$(document).ready(function(){
// Hide rows and add clickable div
$('tbody')
.find('tr:gt(' + (numShown - 1) + ')').hide().end()
$('#table_wrapper').after('<div id="more">Show all offers <span>(' + numLeft + ' more)</span></div>');
$('#more').click(function(){
numShown = numShown + numRows; // 7 + 1 = 8
$('tbody').find('tr:lt('+numShown+')').show();
$("#more").html("Show top 10 offers");
})
})
</script>
Guys,
Given the following HTML
<div class"myclass">10</div>
<div class"myclass">25</div>
<div class"myclass">50</div>
<div class"myclass">20</div>
I want Jquery to return the maximum value found on divs with class:"myclass". (This is 50)
I thought of using .find.text() will be a good starting point but cant figure out exactly how,
Help is greatly appreciatted,
Thanks
Is there a case insensitive version of the :contains jQuery selector or should I do the work manually by looping over all elements and comparing their .text() to my string?
how would i select the following in jquery
<ns:text value="my value" />
i have tried selecting it like so:
1:
var x= $('ns:text').attr('value');
return x;
2:
var x= $('text').attr('value');
return x;
but nothing so far... i don't know if it is possible or not but ...
Thanks
I have 6 columns in jquery grid..
Initially I need to hide the 6th column for user..
I did that made Visible= false for that perticular column
now I need to make disabled that column perminently that is i should not give access for the user to sort or do something else on the column only readable?
thanks
I am trying to post data from my form to a jquery dialog that loads external content.
I am serializing the form data which works (appears in the url) but the dialog won't open:
$("#wavajax button").click(function() {
$.post({url: 'player/index.php', data: $("#wavajax").serialize(),
success: function (data) {
$("#recordingdialog").load("player/index.php", [], function(){
$("#recordingdialog").dialog("open");
}
});
return false;
});
What am I doing wrong, am I going about it the right way???
Hi,
I need to target all links with a class of hslide and attach this to them. Any jquery guru's out there know how to do this?
onclick="return hs.expand(this, { slideshowGroup: 'groupC0', wrapperClassName: 'rounded-white', outlineType : 'rounded-white', dimmingOpacity: 0.8, align : 'center', transitions : ['expand', 'crossfade'], fadeInOut: true });"
Thanks,
C
jQuery is great especially its plugin but I do not like to add a lot of script tags in my html. Is there something similar to dojo.require? So I can manage those plugins easier and cleaner.
I am new to jQuery, but I would like to have a button that when clicked will add more textboxes to a page. I have three textboxes that contain data of the same type and if the user has more data of the same type to enter, I would like to pop up three more textboxes.
What would be the best way to go about that?
I try to do an AJAX call with jQuery and $.post in Internet Explorer, but all I get is an error saying "Permission denied". The problem is kinda weird since it occurs only when I access a page after I was on any other page.
For instance I type the URL in the adress line and let IE load the page. Then I click on a button so the script should start loading JSON data. (The script providing the data lies on the same server and I access it with a relative URL, so using a different domain is not the problem here. Even tried to use a absolute URL with the same host part.)
But when I refresh the page then and try it again it works! Same thing when I come to that page from another page. At first nothing works, but when I click "refresh" everything is fine.
IE gives me the error message "Permission denied" while in every other browser I don't notice this behaviour. Since I have tried many things and still cannot imagine where the problem lies I'd like to ask you what you think the problem might be?
In the code snippet below, from my jQuery setup, I need to check if the image file actually exists and if not, I'd like to substitute a default image. Currently if the file does not exist, I just get a broken image placeholder...
$('#myTheme').change
(
function()
{
var myImage = $('#myTheme :selected').text();
$('.selectedImage img').attr('src','../wp-content/themes/myTheme/styles/'+myImage+'/screenshot.jpg');
//if screenshot.jpg does not exist, use "../../default.jpg" instead
}
);
Hello,
When the value is entered, I want an alert, its a copy/paste text box, using jquery
('#test).bind('onblur',function(){
var h = ('#test).attr('value');
alert(h);
});
<input type=text id=test>
Thanks
Jean