jquery

accordion faq in wordpress

Hello! I would like to make a simple collapsible faq in wordpress. There are accordion menu plugins out there that offer way more features than I need. But I'm having trouble getting things to look right with the Simple Content Reveal plugin. I'm ready to try writing my own jquery code for the first time. I will need step by step in...

Declare javascript function, jQuery

Hi, in my main js file where I put all my jQuery stuff I have following new funcitons: function getDate(){ var currentTime = new Date(); var month = currentTime.getMonth() + 1; var day = currentTime.getDate(); var year = currentTime.getFullYear(); return day"."+month+"."+year; } function getTime(){ var current...

jQuery UI Accordion (hiding all by default)

Hello I am using jQuery UI Accodions By default, the first accordion is shown and other are hidden. I would like to hide all the accordions by default until the user clicks it. How do I do that ? Thank You ...

Make div popup next to a link.

Hello! I am looking for a very simple solution (using jQuery) to let a small popup div appear next to whatever link I click. I know how to make divs show and hide but the problem is I do not know how to make them appear just next to the link I called them from. It would be perfect if I could use the same div for all the popups no matte...

How can I target a variable with string content in a jQuery wrapper ?

Basically what I am after is this, var foo = 'I am foo!'; alert(window['foo']); // output = I am foo! This does not work in a jQuery wrapper, I understand that it may be due to jQuery having renamed the window object or whatnot. If anyone has any inkling as to if this may be possible in a jQuery wrapper, I would appreciate the knowle...

override inline css with jquery and/or css

How do I remove the font size and the bold code with jquery and/or css. I tried a variety of methods but cannot seem to get it. I tried adding a class and then styling it via css and !important but that only worked if I put font-weight:lighter, I cannot seem to override the inline css so I said why not simply remove it. The select...

Jquery / XML No response when using xml generated from a php file

I want to load a xml file using Jquery . The xml is generated using a php script (Currently just using echo) My problem is that the file will just not produce and results . My Jquery is listed below $(document).ready(function() { $.ajax({ ...

change color of selected menu tab

so i have grabbed a snippet from another question <script type='text/javascript' > $(document).ready(function () { $("div.content ul li a") .mouseover(function () { var t = $(this); if (!t.hasClass("clicked")) { // very easy to check if element has a set of styles t.addClass('mouseover'); } }) .mouseout(function () { // a...

googlebot vs 302 document moved message

Hi, I tried searching for the same issue but couldnt find the right answer for me. Anyway, I have a site http://mysite.com but the index.php from the root is going to redirect to a subfolder say, http://mysite.com/pages/index.php and on google webmaster tools fetch as googlebot i get the document moved message. And no indexing seems to...

Why getting an outer HTML does not work ?

I try to get the outer HTML in two different ways, based on this question. Unfortunately, none of them is giving the expected result: HTML: <div id='my_div'>Hello</div> JS: $(function() { document.write('[' + $('#my_div').clone().wrapAll("<div />").parent().get(0).innerHTML + ']<br />'); document.write('[' + (new XMLSerializ...

JQuery - Check if next element of DOM has some classname

Hi. Ive this code : <div class="content"> <div class="tlcontent"> <div class="sideon" id="sideline0"> somethings </div> <div class="trackon" id="trackline0"> somethings </div> <div class="sideon" id="sideline1"> somethings </div> ...

How does Wowhead.com do item popups across fansites?

If you run a site that links to world of warcraft items, you're probably using the wowhead.com javascript to bring their item popups to your site. See it in action here, mouse over the "King Dred's Helm" link. It will popup Wowhead.com's info. is this just a jsonp callback to their site? I want to implement something like this on my si...

How do i grey out the input field and the submit button

I want to grey out these two things the song input field and the submit button until the user enters and artist. Is there an easy way to do this via JQuery. the id of the artist input field is #request_artist ...

Does it make any sense to use JSLint and follow it?

Lately I've been writing some JS code using jQuery and JavaScript as it is and I thought I will give JSLint a try. Let me say that the code contains various functions and jQuery usages and it works fine (without any errors ) in IE8 and latest Firefox. The code also validatas as XHTML 1.0 Transitional (and Strict too but I mostly want it ...

Cleaning up the jQuery in rails

I have a rails application and I have all the jQuery scattered out in alot of different views and this is really ugly.I really want the jQuery in one place but when i take some of the jQuery code and move it to the application.js file the jQuery doesnt work or is maybe included last....I really dont know the issue. Can i have some help o...

find a node in xml using Jquery

Hi I am really new to Jquery and have a problem with my script , I want to access the 2nd 'heading' tag in my xml file using jquery . this is my script so for but what I want to do is assign a vairiable to the 2nd value of heading . $(document).ready(function() { $.ajax({ type: "GET", ...

Where do i put this jQuery in a rails application

I have this chunk on jQuery and currently its living in my index.html.erb and it works well. I have alot of snippets like this that i want to move out of the views and into some other file or files to clean them up. Here is my snippet $("#request_artist").autocomplete({ source: function(req, add){ $.getJSON('<%= ...

jQuery elastic set min height for textbox

hello, this plugin elastic, (function (jQuery) { jQuery.fn.extend({ elastic: function () { var mimics = ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'fontSize', 'lineHeight', 'fontFamily', 'width', 'fontWeight']; return this.each(function () { if (this.type != 'text...

After .load, div won't change height, but after second it will

Hi everyone! Let's get straight to the code: $(".btn-slide").live("click", function(e){ if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } //deo za dobavljanje odgovarajuce stranice link = $(this).attr("href"); if($('#post-content').hasClass("active")){ $("#post-content").slideT...

Making a modal window persist after form submission

Hello, I have a modal window with a login/sign-up form. I would like to prevent the modal window from disappearing after I submit one of the two forms. Any ideea how can I do that? Here's my jQuery code: $(document).ready(function(){ $('#pop2').click(function(){ var width=$(window).width(); width = (width/2)-350; $...