external file
Hi, I am trying to put my code into an external file so i can use it in multiple pages here is the code: (function(){ // back to top var button = $('#back-top'); button.hide(); // fade in button $(window).scroll(function(){ if ($(this).scrollTop() > 600) { button.fadeIn(); } else { button.fadeOut(); } }); // scroll body to 0px on click $('#back-top a').on('click' , function(){ $('body,html').animate({scrollTop: 0}, 600); return false; }); })(); it works fine normally, but when put into an external
Problem with play() function
Hello I wrote a mini-game in "plain" jQuery and wanted to add some sounds. I used HTML5 and <audio> tag with js play() function. It works but in some browsers (yes, I'm talking about IE, but also Safari on PC has this problem) play() function is not working, and, what's is worse, crashes a game a bit, since it's the "Object doesn't support this property or method". Is there any way (maybe an "if" statement) to check if the browser can use play() function and if not tell it to avoid this part of code?
reference to asp.net button not working
Hi all, I am new to jquery so sorry for the silly question. I am not able to make a working reference to buttons inside an asp.net page Here is my page <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplicationTest._Default" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
jquery scrollintoview smoothly
Hi, I'm working in an iframe which have several span elements with id's- I want to select an element, and doing this I want the iframe to scrollintoview slowly until we can see the element. Is there a quick way to do this in JQuery? I can do this but with scrollintoview in javascript, but it is very fast: Regards,
something about css api
ok yes it's a short hand and a much facilitated function over the dom that actually does the dom call instead of you $().css('color','red') is equivelant to document.getElement............ .style.colr in this case color matches but the quesion is when i have something like $().('text-align','center') the dom style.textAlign the question is what is the dictionary that jquery uses
Help with an example
Hi I was wondering if I'm in the right place for help with this, apologies if this is not the correct forum. I have been looking at an example of a jQuery image gallery using jQuery and CSS3. The site is attached. What I'm trying to figure out is as follows. When the user clicks on an image from the initial view, it zooms in to meduim view. I would like to know how to make the image that was clicked on the only image viewable in the zoomed in view - can the other images can perhaps be pushed
Problem with event firing
I'm in the process of migrating from Prototype to jQuery, and have run into a weird issue. The .on() event I'm trying to register only works if I use the older Prototype onLoad. If I switch to the jQuery .ready on page load the event doesn't register: function HOAM_messageboardInit () { if ($j('#message_history').length) { $j('#message_history').parent().find('li').eq(2).on ('click', HOAM_messageHistory); } } function HOAM_messageHistory () { $j.ajax({ type: "GET", url:
getting all textnodes in a frame
Hi, I'm trying to get all textnodes in an iframe, like this: $("*", $(frame).contents()).each(function(){ if($(this).nodeType==3) $(this) .wrap(<span/>); }); But it seems not to be Working as I get only nodes type 1. I have some elements like this: <span><span>this is a node type 1</span>this a text node</span> I want the elements not to have any textnodes as childnodes. i.e., If an element has children, I want all those children to be type 1. I want the above element to be: <span><span>this
checking fields for completion before continuing
what is the best way to show the general status of a section of a registration page? right now, there are about 5 fields. they each have their own check. then there is a check for the section itself. what is the best to verify all at once to change the section check? i was thinking a submit button, but thought the idea of automatic check would be nice. would i just run the check on everykeydown? i just thought this may slow down the browser every time the user presses a key.
IE rolleover/z-index issue
Hey, I am having the darnedest time trying to figure out how to fix an issue I have on bpwgroup.com -- it happens when you rollover the bottom 3 squares. In EVERY other browser (curse you IE) it works as expected and changes out the main box not IE though. Any help/suggestions reworking my JS or even CSS/HTML would be much obliged. -Thanks
I'd like to know how to access a control on another page.
Hello all: I'm new to the forum and jquery, and I'd appreciate anyone's help if you can spare the time. My question is this.... I have a page that by way of an iframe, it houses/hosts several other pages within it. I would like to know when I'm sitting on one page, how I could change the value on another page's control using jQuery? Thank you in advance: Frank
required validation not working
Hello, i have the following html input element in my form using twitter bootstrap: <div class="control-group"> <label class="control-label" for="input01">street_number</label> <div class="controls"> <input type="number" class="span2" class="input-xlarge" id="street_number" name="street_number" value="<?php echo $this->property->street_number ?>" rel="popover" data-content="Re-enter your street_number." data-original-title="street_number" > <input type="text"
document.activeElement.className equilavent for firefox?
Hello guys, document.activeElement.className this coman does not work on firefox, do you know what should I use instead of this in firefox? Thanks
.ajax to call rest web service
Here is my code, however it always call error function $.ajax({ url: "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer", type: "GET", error: function(e){ console.log("error call"+e); } , success: function(resp){ console.log("success") ; } }); can anybody tell me what is wrong in this code? Thanks
traversing elements...
i have a long 3 column list. how can i assign a class to every li element? eg: .green to 1,4,7,10.... .yellow to 2,5,8,11.... .purple to 3,6,9,12.... i can do it manually: http://jsfiddle.net/timur/DAHgG/ but whats the smart way to do it?
jquery trim \  character
Hi, Why doen't jquery trim function removes this special character '\ '? Any way of removing it?
Search Page Div Not Refreshed When New Search Filter Selected
I have the following code on a website in a test search page associated with a search filter on the page: ${esc.d}('${esc.h}productSearchResults').empty(); ${esc.d}('${esc.h}productSearchResults').load('test-ajax-products-page.html ${esc.h}testDataResults'); The first time in it works almost perfectly with most of the expected data coming back from the "#testDataResults" div of the "test-ajax-products-page.html" page which is a target test page. The second or more times that the search filter
animation with mouse over ?
Hi Guys, i am very new to jQuery and i have some problems to stop or reset an animation after a mouseover event. $(document).ready(function() { elementResize(); $(".box1").bind("mouseenter ", function() { $(".boxtext1").animate({ top: '-=100px', height: "show" }, 200, function() { // Animation complete. }); }); }); Edit: I added this: $(".box1").mouseleave(function() { $(".boxtext1").animate({ top: '+=100px',
configuring jquery ui with aptana using xampp..help!!!
aptana, jquery ui and xampp...i wanna know how configure my jquery ui with aptana?! i pasted my custom files in my webserver host and i tried to "call it up" by : <script type = "text/javascript" src = "jquery-ui-1.8.22.custom.min.js"> </script> saw this in "javascript and ajax for dummies" please help im new to this!
dragging paragraphs from an iframe to a container
Hi, Is it possible to drag a paragraph or a span element from an iframe and drop it into a container?
On select a image in dropdown
Hi, I am new to JQuery, please help in resolving the following issue that I am facing, If I click the above arrow, the following images will be displayed as a dropdown Here I want to select an image by click the same and that selected image should replace the dropdown arrow. Please help me in this problem Thanks in advance. :) Suren
JQuery Command/Method Question
I'm very new to JQuery and am trying to get a test page to work using code found in a DOTCMS/JQuery tutorial. As part of the tutorial I have the following piece of code in one of the code blocks: var url = "test-ajax-products-page.html"; ${esc.d}.ajax( { url: url, type: "GET", data: "cat="+cat, dataType: "html", success: function(data) { ${esc.d}('${esc.h}productSearchResults').html(data);}}); I'm not sure I completely understand what this part: ${esc.d}('${esc.h}productSearchResults').html(data);
.html() and .detach() fire too soon - before .slideUp() even starts, how can I control the order?
Code below controls the form validation output: shows the "error String" right under the input element that didn't validate. My plan was: 1. Check if there is an element I'm about to create. (e.g. <p class=".alert">First Name is required</p>) 2. If it exists: -slide it up -edit it with new information -detach it If it doesn't: -create it -apply display:none 3. Insert where it is needed 4. Slide it down. That's the idea. First run (creation) is ok. On the other hand,
page loading breakes code..??
Why does jQuery functionality not working when loading external pages? when the HTML is one big page, the toggle function works: (click on the top left image) eg: Single HTML File however when i load the header with 2 separate html files, the toggle function doesn't work eg: Multiple HTML Files This is my code:
columns re-sizable and shorten too long names - Datatables
Datatables is a great tool but i don't know how you can do these 2 things: - Add the option to manually change the size of the columns, drag them to the right or to the left to suit your needs. - Shorten the too long text. But with Datatable the text wraps. In this way, however, the cell size increases. And I do not want to get this effect. This is an example of how these 2 things are well integrated with the Firefox plugin "Downloadthemall". Look here: http://img811.imageshack.us/img811/1387/downloadthemall.png
Realtime table searching optimization
I have developed a realtime table filter that works very well on small tables, but when you get table that has many rows it gets choppy. It runs especially slow on older computers/browsers. By looking at my code below, is there anything that can be done to make it speedier? As a last resort, i considered using ajax to reach out to the server instead… //Start of document.ready $(document).ready(function () { var selectedAccountGroup = $("#filter").val(); var accountsTableData = $("table#"
Getting window size to php variable without pulling a second page.
I have a search script I wrote in php which parses any url and returns data based on the url and it uses the SHTML and apache forcetype to use only one page. I've rewritten the code to use a fluid page layout. I'm trying to get the the browser window size so if they are on a phone it will pull smaller ads and on a desktop it will display the larger ads. I have tried a lot of different scripts and got it to work if it pulls a second page while setting a session var but it messes with the parsing...
Handling Event Propagation on an Expandable Menu?
So, I've got the following expandable menu: <ul id="navigation"> <li><a href="index.html">HOME</a></li> <li><a href="aboutus.html">ABOUT US</a></li> <li id="expand"><a href="collection.html">COLLECTION</a> <ul id="active"> <li><a href="collection1.html">ANTIQUE DOLLS</a></li> <li><a href="collection2.html">DOLL ACCESSORIES</a></li>
$(this) inside append()
hi, i would like to append the name attribute as text for some elements on my web site to test something. i have tried: btn_group = $( '.btn-group.alive' ); alert( btn_group.attr( 'name' ) ); //this give me an alert with the right name (it work) btn_group.append('<p>' + $this.attr('name') + '</p>'); //wich doesn't work.. how can i do it?
Help needed: Integrating a domain checker on to a JQuery Slideshow
Hi all, I run a small hosting business and I have recently modernised my company website with many new enhancements. My knowledge for web design is purely based around HTML, PHP and CSS although, very little in Javascript. I have managed to load a very simple JQuery Slideshow on to my website. The slideshow I decided to use was: (http://reallysimpleworks.com/slideshow/) - Which is working brilliant on my website. However, at the moment I have a domain name checker that I have inserted in to a div
How can I wrap selected image with html
Hi people, I have been trying (2 days) to find a way to edit the content of a div containing text and an image. I tried google for javascript methods without any success. Searched also for a jquery method but not getting anywhere. Apologies for being such a dummy over this, maybe it is just outside my ability or maybe I'm too thick. The objective is to add centering to am image which is in a div. An example might help me explain. What I have is this :- <div id="details" contenteditable="true">
modifying css of buttons
i have a page of plan selections, and buttons for each plan. there are two per each (one at the bottom, and at the top) for the same plan. I would like a user be able to select one, and the css of that button plan type change, and if they select another one, revert the previous css of the one that was changed, and apply the changes to the newly selected one. would i do something like this?: $('#buttonPlanSelect').each( function( index ) { $(this).addClass('test'); // changes all of the buttons
jquery textarea keep formatting
Hi, I've loaded a html file to a text area, but it looses the formatting. with iframes it doesn't happen feeding source with html file, but with textarea is not working, and I need to use textareas. Any Ideas? Regards
set textarea content with html file
Hi, How to set a textarea content with a html file? Regards
AJAX and jQuery - How to locate files in a specific folder?
Hi, Since a few days I am into jQuery and I am getting the hang of it with the basics. I have this script here which uses jQuery and AJAX - it makes you switch between pages without leaving the index page the user visits. There were a few problems with the script but I manage to solve these. However, there's one problem left that prevents me from checking if everything works and to make the script run correctly: the script does not correctly locate the .html-files it requires to switch between pages.
Check username availability using jquery in cakephp
Click To View Complete Tutorial When i was working on a project of mine then i was stuck for checking username availability using ajax (jquery) then i tried a lot and after all i got a way around. In this post i will tell you about that how to check whether a user already exists or not with provided username. I have wrote complete code below: Code for your view file. This code is to be placed in your views file: Html Code <label>Username</label>
<?php echo $this->Form->input('username',array('label'=>false,
mouse over team page
Hi Guys, Im trying to design some sort of 'team' page for a friend. I have set it so that a box slides up over the image with the description of the person when you mouseover. Once that loads up, if the mouse happens to be in the message, the animation starts again!!! I created it so that there was a box ontop of it all which is transparent that would show the message underneith, but then i realised... "duh, text not selectable... bye bye links!" Here hs a jsfiddle of my issue. Could any one help?
How to work with Jquery mobile in offline mode?
I get some code about single and multipages and I would like to use this code in the offline app. I thought that was enough to remove the URL of links to the files jquery.mobile-1.1.1.min.js/jquery-1.7.2.min.js/jquery.mobile-1.1.1.min.css, but that did not work . How can I do to work in local mode? Thanks
overwrite events after cloning object
Hi all, this i my first post here and i've searched the forums and didn't find any solution for my problem. I have a JS-Class that contains data and jQuery-DOM-Objects like: function MyClass { this.property = 'somevalue'; this.another = 'anotherValue'; this.$head = $('<div />', {' class' : 'niceclass', click : $.proxy(this.doSomething, this) }; } MyClass.prototype.doSomething
how can i retrieve the boolean values from database and display in a listview??
hi all, i was trying to retrieve boolean value from database and display in a list view.. for that i want to design a checkbox,for that checkbox i have to keep a star image,when i click on star it has to update the value in database and retrieve list in listview..please have a look at this screen shot for better idea.. please help me out..
Next Page