Skip to main content

Posts

Showing posts with the label html

First JQuery project… a little stuck

Last night someone on here really helped me out a lot with my first validation from scratch, i brought it alot further since last night. This is the first time I'm touching JQuery, I apologize for my crumby coding. Here's what I have that works fine and dandy for the validation UP until the last else statement: //VALIDATE FIRST REGISTER PAGE! $('#submit1').live('click', function() { check_value1(); }); function check_value1(){ var firstname = $('#firstname').val(); var lastname = $('#lastname').val(); var email = $('#email').val(); var password = $('#password').val(); var username = $('#username').val(); if(firstname =='' || firstname.length <2) $('#fnameError').fadeIn().fadeOut(5000); else if(lastname =='' || lastname.length <2) $('#lnameError').fadeIn().fadeOut(5000); else if(email =='' || email.length <5) $('#emailError').fadeIn().fadeOut(5000); else if(pass

Set element to Hidden when clicked

I'm putting together this basic script for a site: http://jsfiddle.net/mcgarriers/rVPnu/2/ It works great when I select the various numbers (it shows the relevant divs) but when I go back to click "Select" it still displays the <div> s. I'd like it if the user clicks "Select" that mySpecialElements is hidden again . Can someone show me how to achieve this? Many thanks for any pointers.

How do you mitigate risk when introducing multivariate testing into a dynamic web application?

My company is engaging with a multivariate testing vendor (I can't disclose which one just yet), and I am being asked to integrate their system into our flagship B2C commerce site. Usually, the word "integrate" is a heavy-duty term. However, here it means to add a <script> tag on several views, and then be out of the loop from that point forward. The mulitvariate experiments will be set up by our marketing department (and/or the vendor). Our development team will not be involved in that, and may not even be aware when it's happening. Essentially, I am being told to deliberately add a JavaScript-injection attack vector to our flagship application... and hope for the best. My concerns are not so much with malicious code as they are with inadvertent screw-ups. Our CSS and basic page layout is a mess already, and I anticipate catiching the heat when someone else's multivariate experiment blows up the home page look-n-feel, etc. Much more importantly, ther

status box like twitter status box [closed]

I am a new PHP learner. I need a status box which just like twitter status box. I have tried many websites and i can not find the exact solution. What i exactly need is 1. Status box like twitter, when typing on the box it will increase its size automatically 2.If there is URL in the status, it should automatically highlight URL like twitter 3.After 500 characters user should not allowed to type in. I don't want to use any API. I think the code might be combination of HTML,ajax and javascript. Please someone help me. I am new in this area. So if it is possible give a little explanation of your code. I found a bit similar question in this website but the answer is not given there.

How do I remove multiple href links via the ID with jquery?

I'm having issues removing several of my href links that all have the same ID. Here is my code snippet: $('.delblk').click(function(e) { e.preventDefault(); var id = $(this).attr('id').substr(7); $.getJSON("../ajax_blocked.php?op=delete&id="+id, function(data) { if (data) { $("#delblk_"+id).each(function() { $(this).remove(); }); } }); My HTML looks like this: <a href="sent.php" id="delblk_7" class="delblk" ><span class="label label-important">Unblock</span></a> <a href="sent.php" id="delblk_7" class="delblk" ><span class="label label-important">Unblock</span></a> <a href="sent.php" id="delblk_8" class="delblk" ><span class="label label-important">Unblock</span></a>

Firefox 10 - unclickable buttons?

Has anyone seen this behavior: I have a couple of HTML buttons used to drive a content rotator: <div id="rotatorControls" class="rotatorControls" runat="server"> <input name="previous" id="previous" type="button" value="&laquo;" /> &nbsp; <input name="next" id="next" type="button" value="&raquo;" /> </div> The buttons are activated with a little jQuery: $(document).ready(function() { mcarousel = $("#carouseldiv").msCarousel({ boxClass: 'div.box', height: 100, width: 450 }).data("msCarousel"); //add click event $("#next").click(function() { //calling next method mcarousel.next(); }); $("#previous").click(function() { //calling previous method mcarousel.pre

CSS3 transitions inconsistent across FF and Chrome

So I have created a CSS3 animation that does not behave consistently across the different browsers. Here is a quick and dirty overview, and I have included a JSFiddle link at the end. Here is the CSS: .cloned_object { position:absolute; background-color:white; width: 700px; height: 640px; margin: 0; /*for centering purposes*/ -webkit-transition: width 1s, height 1s, top 1s, left 1s, margin 1s; -moz-transition: width 1s, height 1s, top 1s, left 1s, margin 1s; -ms-transition: width 1s, height 1s, top 1s, left 1s, margin 1s ; transition: width 1s, height 1s, top 1s, left 1s, margin 1s; } and the JS function: $('.content_cell').on('click', function(event) { // if the user is on a browser older then IE9 if ($.browser.msie && $.browser.version.substr(0,1)<10) { var $clonedElement = $( this ).clone(true).attr('class','cloned_object content_cell').appendTo('#mainContentTable');

format cell in flexigrid to show value [closed]

Possible Duplicate: How can I format numbers as money in JavaScript? Does anybody know how I can format cell in flexigrid to show value in currency for example euro with separator "," and for cents "." I import value with JSON but don't know how to change look of that number to be like amount to pay. Thx...

Jquery table onclick events

I have A function in jquery which goes to a php file, which querys a database returns the results in a table with a button in each row, how do i access the buttons in the page that the jquery is on. here is some code //function to get table form php file with button on each row function show(str) { $.post('INCLUDES/gettable.php',{club: str}, function(output) { $('#box').html(output).show(); }); } //when button from table is clicked do something $("button").click(function() { alert("hello"); } Any help is appreciated

How to find out whether an element is in a hidden iframe

Using jQuery, one can easily find out whether a particular element is visible using $(element).is(':visible') While having some limitations (doesn't cover css visibility hidden or the actual visibility in the viewport, i.e. whether it's covered by other elements or scrolled away), I find it being useful for my scenario. The catch is, it only works within one iframe. If the element has any parent within its document with display:none; , it returns false. If the whole document is included in an iframe which has display:none , it returns true. Is it possible to somehow detect this in another way ?

How to find out whether an element is in a hidden iframe

Using jQuery, one can easily find out whether a particular element is visible using $(element).is(':visible') While having some limitations (doesn't cover css visibility hidden or the actual visibility in the viewport, i.e. whether it's covered by other elements or scrolled away), I find it being useful for my scenario. The catch is, it only works within one iframe. If the element has any parent within its document with display:none; , it returns false. If the whole document is included in an iframe which has display:none , it returns true. Is it possible to somehow detect this in another way ?

How to scroll down with jquery when user reached a specific part of an image?

It's hard to describe what exactly i was looking for and sorry for my english. What i want to do is, while user scroll down slowly, when user reached a specific point, starting to scroll down page like 1000px and then stop scrolling at the second specific point. Here is an example: http://comic.naver.com/webtoon/detail.nhn?titleId=350217&no=31&weekday=tu It should be cross browser compatible.

User draw shapes on top of an image

I would want to allow user to draw semi-transparent basic shapes (rectangle, circle) with user defined text over an image. The basic idea is to have a map underneath and users could mark certain areas of from it. It has been a while since doing web development and I'm quite uncertain which approach would be the best. It should work even on older browsers. Any help would be appreciated!

Do myFunction right after JSONP request

I have a script which allows to display Google suggestions: JsFiddle I want to do a function with the first li item rendered by the ui autocomplete, so I did this: $("input#term").keyup(function() { DoMyFunction($('.ui-autocomplete li:first-child a').text(), true); }); The problem however is that there is a period of time between the keyup---> request--->xml cache and html rendering by the ui autocomplete. Which means the my function (DoMyFunction) is being triggered when there is no html list, hence it doesnt work. So my question is: How do I do my function right after the reqeust is cached and processed. Setting a timer wont work because there are to many variables to account for (ea user bandwidth).

User draw shapes on top of an image

I would want to allow user to draw semi-transparent basic shapes (rectangle, circle) with user defined text over an image. The basic idea is to have a map underneath and users could mark certain areas of from it. It has been a while since doing web development and I'm quite uncertain which approach would be the best. It should work even on older browsers. Any help would be appreciated!

jQuery Mobile – Toggle enable and disable state of a radio button

I have a radio button that I would like to be able to enable and disable through jQuery Mobile. Radio button code: <input type="radio" disabled="disabled" value="option1" /> tried: $('input[type="radio"]').removeAttr('disabled'); and $('input[type="radio"]').attr('disabled', ''); Neither of which seem to be able to toggle the button to enabled.

jQuery Mobile – Toggle enable and disable state of a radio button

I have a radio button that I would like to be able to enable and disable through jQuery Mobile. Radio button code: <input type="radio" disabled="disabled" value="option1" /> tried: $('input[type="radio"]').removeAttr('disabled'); and $('input[type="radio"]').attr('disabled', ''); Neither of which seem to be able to toggle the button to enabled.