Controling last div inside a div.
Hey, I'm trying to achieve this: when I click on the "Zgodovina_Prikaz" div, "Zgodovina_Vsebina" div should appear, which is inside "Zgodovina_Prikazj" div. Here's the code that works now, but I have to add the "Zgodovina_Prikaz" exactly before "Zgodovina_Vsebina" for it to work. $(document).ready(function() { $(".Zgodovina_Vsebina").hide(); $(".Zgodovina_Prikaz").click(function() { $(this).next(".Zgodovina_Vsebina").slideToggle(600); }); }); <div class='Zgodovina_<?PHP echo
Jquery Accordion With Images Hiding on Selected Item
Dear Reader, I'm looking to incorporate images in my jquery accordion. I've managed to do so using CSS backgrounds for both the button div and the header within that div. I'd like to have one of the backgrounds (css) hide while an accordion item is open. I've only managed to make all the images hide at once, and I've had no luck making them come back. One thing to note: each h2 has a unique class to determine the background image. If the solution is indeed to use the .css() function, I'm assuming
[jQuery] [treeview] Node click behavior
Is there a way to make a node in the treeview expand/collapse ONLY if the +/- is clicked but not the folder icon or folder name but still make the node selectable?
post form to external host
hello every body i have a form and i want to post it's fields to external page like <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("input:submit").click(function(){ $.post("http://xxxxxx.net/login.php",{email:$("#email").val()},function(data){ $("#contents").html(data); }); return false; }); }); </script> this code not working and return no thing but when i chang the url to local page it working fine <script src="http://code.jquery.com/jquery-latest.js"></script>
How to remove body inline css
var s = document.body.style.cssText.match(/[\w|-]+:/gim); jQuery.each(s, function (key, value) { var s2 = value.replace(/(-)(\w)/gim, value.match(/-\w/gim)[0].toUpperCase()); eval('document.body.style.' + s2.replace(/[-|:]/gim, '') + " = '';"); }); That's how to remove body inline css by me.
can anyone know how to add a span tag around a input tag
can anyone know how to add a span tag around a input tag $(document).ready(function() { $('input[type="submit"]').each(function() { $(this).before('<span class="box1"><span>'); $(this).after('</span></span>'); }); }); the above cord is not working properly..
LightBox problem
Hi guys i am haing a conflict this works greta in IE but not in fire fox for the lightbox to work. this has me stumped it is some thing to do with the script above it because when i delete that it works? any ideas <head> <title>Buffalo Web Design | Portfolio</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <link href="style.css" rel="stylesheet" type="text/css" /> <link href="layout.css" rel="stylesheet"
How to select specific Row, Col ( TR, TD)
Hi ,I´m totally new with jQuery as of today. What i´m needing is to select a specific row inside a table and a specific cell within that row. The only things i know about the row is its position within the table. It occupies row #14 and the cell is #0 within that row. how can I do that? Thanks in advance Mauricio
jQuery Themeroller-can't create my own image
Hi, I'm very new to jquery and Themeroller, but I have a question. I successfully used the tabs and the images that are generated through the custom Themeroller. But I want to further customize the tabs into my own design, but when I do that, using the same size and changing out the pngs, keeping the exact file name, it doesn't show up. I then go back and substitute back the png from the Photoshop file I created (using save to web), and it works great. Why is the file (css) not taking my design
Does anyone know why ??
Hi. Does anyone know why or how can I insert, into a determined element with id, a gif loading animation while the $.ajax() is running ?? I couldn't do it :-( Thanks to all
jQuery Development
I have more of a general theory question for jQuery developers. I recently completed a project written in PHP and jQuery. Everything went very well, jQuery was nice and easy to work with. As I developed, I put an emphasis on using only ajax calls to get data from the database and letting jQuery handle my GUI. Basically the browser never refreshes when you use the application. My thinking was to make it more like a Windows application and less like a web site. From the users perspective, they
AJAX form submit and emailer
Hello everyone, I'd like to set up a basic submit form that will send an email to the webmaster (that would be me in this case) whenever a user fills out a form, then I'd like to AJAXify it. Here are the gotchas: I'm working locally on a WAMP server, and I don't know if the host has sendmail in its bin directory since I don't have access to it. FormMail uses Sendmail, and I think that FormMail is the solution I need to get this done. Oh, and I don't want to use PHP unless I have to or if it'll make
Is it possible to load a page with jquery that uses javascript?
Hello! I am developing my personal website! And I am trying to implement it with JS completely. which means I need the page to be one front end page. But the back-end pages would be the ones which do the work and calculations! In other words and more explaination: I would like to have one "index.php" page that contains only a nav bar which handles the mission. Once the page load it loads with the content of "home.php" (the landing page) if the "contact" tab is clicked then I would like to load the
slideDown leaves display block
Please try this example If I use slideDown effect it leaves an inline style="display: block" that causes the list ordinal to be hidden. How do I solve it?
my links saved into a database do not work like the normal links
My problem is the following: I am programming a searcher and I am using php too and saving the key words and the links into a database, but the links gotten from my database don't work like normal links and don't replace the content on a <DIV> that I want but other page is opened. What I mean is this code does not work when 'a' is from a database -> $('a').each(function(){ var href = $(this).attr("href"); $(this).attr({ href: "#"}); $(this).click(function(){ $("#contenido").load(href);
AJAX question
Trying to do something with AJAX--and failing. Any help welcome. I have a bunch of pages (page-1.php, page-2.php, etc.) that all share a navigation menu (menu.html), which menu is included in the pages server side. The pages all use jQuery and (obviously) PHP, but the menu is (at the moment) straight HTML. Now I need to add to the menu an item (menu-item.php) that is fetched by AJAX, with which I have precious little experience (in JQuery or anywhere else). I figured I could just add it to menu.html
Live() Mouseenter mouseleave? Child div on hover dissapears. please help me.
$( '#editableimage' ).live( 'mouseover', function() { var topar = $(this).offset().top; var leftar = $(this).offset().left; var elementwidth = $(this).width(); var customoffset = elementwidth - 32; var lefta = leftar + customoffset; var topa = topar + 10; $('body').append( '<span id="editimg">asd</span>' ); $('span#editimg').css("top", topa+"px").css("left", lefta+"px").fadeIn("slow"); } ) .live( 'mouseout', function()
How to find next Node In Focus Order?.
Hi! I am writing a programmatically control the focus (basically what I want is to transform "tab" to "enter")... why do I want such a non standard thing? Customer request... and since he is paying, I have to implement it. Now, currently I solved the problem by finding the next element with a greater "tabIndex" value, but that forces me to configure tabIndex values for everything in my form... and that is specially problematic because some of my UIs are generated dynamically with information in the
array using makeArray()
I am trying to achieve edit/update functionality on a table. /************************************************/ tabData = jQuery.makeArray($("#" + RowID)); alert(tabData[0].innerHTML); //Change the current row's cell to textbox ChangeTableCellToTextbox(RowID); alert(tabData[0].innerHTML); /************************************************/ 1st alert shows all row elements when user hits edit, ChangeTableCellToTextbox(RowID) replace table cells with text input. but when user hits cancel, I want original
I have a jQuery doubt
Does anyone know what are the jQueryNNNNNNNNNNNN="XX" that The IE Development Tools shows ?? And how they work ?? And what are they for ?? I leave a ScreenShot. Thanks
stuck with re-binding to jquery lightbox to ajaxed content (in cache?)
Hello, I have a problem, mainly because I really am not into code and when I read the faq on re-binding I basically can´t follow as I don´t know how to get from a click event to something that fits my scenario. which is: I load new content into a div "content" with this simple function: function loadTemplate( template, divToLoad ) { var req = new XMLHttpRequest(); req.open('GET', template, true); req.onreadystatechange = function () { if (req.readyState == 4) {
Select all links that don't have javascript in the href nor have a target of "_blank"
Is there a simpler/better/more elegant way to do this? $('a[href]').not('a[href^=javascript]').not($('a[target=_blank]')) Thank you! Scott.
Load different html content into two divs on one click event??
Hello all, I am currently using load() to display content upon clicking a line. I would like to add another load function to the same anchor's click event. I tried applying the click function to the sam a.class but it did not work. I have the load a.class within an accordion. here is my current jQuerry functions on the page $(document).ready(function() { //ACCORDION BUTTON ACTION $('div.accBtn').click(function() { $('div.accContent').slideUp('normal'); $(this).next().slideDown('normal');
Click Function Fires Twice With Alert
I have defined a function that I attach to a field using the .click() function. My function checks a value and then either displays a hidden div or pops an alert box. Displaying the hidden div works fine, but for some reason the alert box pops twice. I'm guessing it has something to do with clicking the "OK" on the alert -- somehow it fires the click() event on the field a second time? I've gotten around it by putting the following code at the beginning of my function: if (typeof(event)
How to know when an element is removed
I'm really excited that cleanData is exposed. I can overwrite it to let me know when an element is removed. However, I'm wondering if this is the expected way. I notice that each event.remove is called in cleanData. Is it expected / possible to use custom events to callback a function, letting something know that the element has been removed? I'm going to experiment later today with this. But I'm hoping there's already an answer.
Simple fading slideshow hogging cpu
I've got a fairly simple slideshow object which takes an array of images and rotates through them, with a fade between each picture. But it seems to use a fair amount of cpu, especially on IE, a little less so on firefox. Any ideas on how to optimise this? Is the object too self-referencial? Are the function calls maybe too static? Cheers function picSlideShow(elementID, picArray) { var self=this; this.id = elementID; this.picArray = picArray; this.pointer=0; this.fadeOutPeriod=500;
Dynamic Combobox with JQuery
Hello, Why within JQuery, the combobox add method doesn't seem to be recognized as with traditional html combobox here: http://viralpatel.net/blogs/demo/dynamic-combobox-listbox-dropdown-in-javascript.html Thanks.
Change output on option select
Hey all, I'm having some trouble with what seems to be a fairly simple issue: I have a <select> field with a few options inside of it. The idea is that a user can select an option in this dropdown and, dependent on what they choose, the output in another div with change. The form: <form class="formStyle"> <fieldset> <label for="soFormStyle">style:</label> <select name="soFormStyle" id="soFormStyle"> <option>Select Style</option>
dataFilter option - I'm beggining to loose my mind
Hi, jQuery offers the ability to set a DATAFILTER for all AJAX calls. I would LOVE to use this feature, so I tried implementing this... This is the code on the client that I have: jQuery.ajaxSetup({ dataFilter: function(data, dataType) { if(dataType == "json") { var obj = jQuery.parseJSON(data); if(obj.meta.flexin.is_generic_json) { // We have a generic flexin JSON object, let's process generic stuff here...
stuck with re-binding content in cache (?) with jquery lightbox
hello! I have two problems: one being that i´m not very much into code and the other one having to re-bind the jquery lightbox selector to new content loaded into a div with a simple function. I read the faq on re-binding and get the idea but I´m lost once it goes about a click event and what not. here´s what I have: in a flash menu this simple code fires a function "loadTemplate" described in a separate js-file: getURL("javascript:loadTemplate('templates/seite"+signal+".txt','content')", "_self");
bind works but live does not work for multiple events
Following code works. $('#container a').bind('click', function(e){ log( $(this).text() + ' clicked1'); return false; }); $('#container a').bind('click', function(e){ log( $(this).text() + ' clicked2'); return false; }); However in the following case the message I get is : clicked1. No message from clicked2. Is this expected from live? $('#container a').live('click', function(e){ log( $(this).text() + ' clicked1'); return
Animate to width: auto; instead px value
Hello, is it possible to animate the width of a div to its max size that content needs instead of saying "animate to a width of 500px"? Any hint would be appreciated! Would I have to find out the needed width first? Cheers!
Resetting body css background-image
If I try to reset the css-properties of the body of my page with this line of code: $("body").css({"background-image":"url('../images/bodyBack.jpg')","background-color":"#f5e7af","background-repeat":"repeat-x"}); It sets the background-color correctly, but the background-image isn't set. What do I do wrong?
Using the remove function in list items
Hi, I am having difficulties to deal with a simple remove function. I have an item list with "listitem" css class. I placed a button on each item to delete it. I am now trying to use the remove function to erase it from the page. I thought $(this).remove(); will work but it doesn't. I also tried something like this: $(this).parent('.listitem').remove(); but it didn't work. When I write $('.listitem').remove(); it erased all the items of the list. I m just trying to be able to erase just the one
canceling a circle callback
Hi Folks, quick example: function endless(){ $("element").animate({left: '-=100'}, 1500); $("element").slideToggle(500); $("element").animate({left: '+=200'}, 1500, endless); }this code will obviously repeat over and over, I'm wondering how to intercept that whole thing in a jQuery'ish way? Is that possible without an own logic boolean check? Kind Regards *edited* In the same context, a native js question. If one sets up a timer with setInterval, the returning identifier for that timer
Function To Pass 3 URLS one after the other
Hi There, I'm new to JQuery & JSON. Below is my code. <body> <h1 id="title"></h1> <script type="text/javascript" language="javascript"> $.getJSON("http://localhost:8090/wflow-wfweb/web/json/workflow/process/start/mdec_eforms%232%23apply_leave_form?j_username=andrew&j_password=password&format=json&jsoncallback=?", function(json){ $("#title").html(json.activityId); }); </script> </body> If I copy paste the url, i get the following JSON data. {"activityId":"810_810_mdec_eforms_apply_leave_form_apply_leave_form_act1","processId":"810_mdec_eforms_apply_leave_form"}But
:visible Selector
:visible wont work on <table> <col/> <col style="visibility: collapse;"/> <tbody> <tr> <td>visible</td> <td>invisible</td> </tr> </tbody> </table> like this $("table").find("col:visible")
datepicker doesn't execute when submited
i been working this for a days but i don't get it so i decided entered this forum. i really have hard time tracing where is the problem of my code.. here my code: $(".editME").click(function(){ var element = $(this); var show = element.attr("id"); $.get('index.php',{option:'myReports', task: 'edit', id: show},function(data) { $('body').html(data); $("#editFile").show(1000); }); return true; });when i click the
What about jQuery and MVC
Hello, I wonder if there is an easy way to build a MVC app. My aim is to have a easily updatable code based on a perennial framework. > Does jQuery proposes something for a separate Model View and Controler ? > Is there a well-known plugin to handle this kind of programmation ? > Maybe plugins are not necessary. Is there a tutorial for that ? Thank you for your help ! K.
Is it possible to highlight a link based on partial URL?
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. Right now I'm having code like this $params = getQsParam(document.location.search); if ($params.br != undefined) $(">li>a[href*='&br="+$params.br+"']", panel.series).each(function(){ if (getQsParam(this.href).br == $params.br) { $(this).parent().addClass('active');
Next Page