How would you form an if statement in a jQuery function, then call that function using a .click() handler?

1 Answer

Answer :

Can you show us what your current code looks like? Perhaps you could paste it to http://jsfiddle.net/ or https://gist.github.com/ and give us a link? It’s easier answer if we’re referencing the same things.

Related questions

Description : How can I write Jquery codes to select a certain element?

Last Answer : Try $(‘div.FatherDiv div.Common:first-child’)

Description : Why is jQuery so much more popular than Prototype and Scriptaculous?

Last Answer : Some reasons off of the top of my head: 1. It is smaller 2. It is faster 3. It is easy to extend (plugins and such) 4. It is true to javascript. Prototype is like a ruby-ized javascript

Description : JQuery: wait for other event to finish?

Last Answer : JQuery uses callbacks as an argument to nearly every animation function.. It works by passing a reference to the function you wish to call in the same manner you are passing a new function with the a.click ... #photoViewer').fadeIn(250); }); // close fadeOut() callback }); // close click() callback

Description : JQuery plugin to give a really large table a scollbar?

Last Answer : this isnt so much a Javascript problem, but a CSS problem. However, tables are known to be finicky about CSS at the best of times, and scroll bars are probably the worst thing to try and do :/ ... possible to do, but its going to be buggy and maybe even broken completely in browsers such as IE6.

Description : Why DONTCLICK.IT didn't click with anyone?

Last Answer : answer:Because, while dontclick.it is a phenomenal concept, executed beautifully, the fact remains that clicking is still the most effective, accurate, and flexible method for selection-with the possible ... is just well default. You can design a website that way without thinking about it.)

Description : Is there a server-side utility that I can call from PHP to automatically resize and crop an image, such as an avatar, uploaded by a user?

Last Answer : http://www.imagemagick.org/script/index.php

Description : Is there a server-side utility that I can call from PHP to spell check a user's input from a text box?

Last Answer : There are a bunch of them out there. Here’s a PHP spell checker class.

Description : Useful Dreamweaver function in Coda/Espresso...?

Last Answer : I’m not quite sure what you’re after here, could you give me a bit more detail?

Description : What is it about certain websites that prevents you from using the Back button?

Last Answer : I expect that they want to hold you there long enough to be malicious.

Description : Experience using WordPress for a website?

Last Answer : I've made dozens of websites with WordPress, both for static content, blogs, a blend of both and other things entirely (that involve heavy customization). There are themes that are meant for either ... idea. There are tutorials that will point you to some good plugins which help along that approach.

Description : How can I hide HTML elements using just CSS?

Last Answer : visibility: hidden; opacity: 0;

Description : I know that you can imbed image sets from Flickr to a blog but is it possible to do the same to a regular website? And if so, then how?

Last Answer : Does this help with what you want? edit :: and note the part in the code that says count=10 You could probably bump that up to a bigger number. Say like count=25.

Description : Are there alternatives to multi-line comment boxes in a contact form?

Last Answer : Wow is that the wrong way to go about solving your problem. The correct answer is not to restrict what a user wants to tell you, but to ensure that your site is secure. If you don't already have an ... you aren't using HTTPS, start using it. If you aren't encrypting the transmission of data, do so.

Description : PHP help... contact form problem.

Last Answer : You should probably do an ajax form submit and replace the form with the confirmation message. I’ve got to get to bed, but I’ll find a tutorial for you in the morning if someone else hasn’t already. (basically, opposite of this: http://24ways.org/2005/edit-in-place-with-ajax)

Description : Web design (CSS) question: how can I make something like this?

Last Answer : Looks like it’s based on Cargo Collective’s Montessori template and using their tools. They’ve modified it some to use some more concepts from brutalism, but it looks like all the main functionality would be there if you wanted to do the same.

Description : Why does ask-public have Users login with their published user names?

Last Answer : answer:Honestly, there's probably no other reason than because that was the standard at the time. In 2006 (which is when the site launched), basically every website used a username to login. Even now, the vast ... such a ubiquitous login item? (I'm no web designer either, so I can't say for sure.)

Description : What do I need to do to adapt my Web site to mobile devices?

Last Answer : answer:(Link is broken. But it appears to be: mathed.org.) You could either try to use a mobile framework like bootstrap and do this yourself, or you could move all the content into a simple Wordpress site with a responsive theme/template.

Description : From where I can buy web hosting in cheap rate?

Last Answer : answer:Dreamhost.com and Bluehost.com get great reviews for Linux hosting. I needed inexpensive Windows hosting recently and I signed up for SmarterASP.net.

Description : Is there a wordpress plugin that would allow me to put random quotes on my website (like ask-public has?)

Last Answer : answer:I don’t believe the ask-public quotes are random, in the sense they are auto generated. They are manually generated, but randomly displayed. Similar to what a wordpress random quote widget might provide.

Description : Optimizing a Jquerymobile build for my needs?

Last Answer : answer:I'm sure you saw it, but just in case. Please note that the jQuery Mobile Download Builder is still in alpha, and as such should not be used on production websites. But, let's see if we ... build than you want that works, then weed out the unneeded sections one at a time. Until it breaks.

Description : WYSIWYG maker for making expandable blocks (show/ hide toggle blocks)?

Last Answer : Wow. I have no idea, but should identify WYSIWYG as What You See Is What You Get for those who couldn’t figure it out.

Description : To what degree are the problems with the Obamacare website due to sabotage?

Last Answer : Possibly, but a question for any IT folks out there is, wouldn’t the site have been thoroughly beta tested or am I being naive?

Description : How would I add a page-by-page language "switcher" on a website, and should I - details...?

Last Answer : answer:I've not done it before, but it should be fairly easy if you have properly separated your content from your presentation. The nicer-looking way to do it would be to use an XMLHttpRequest in ... but it gives you the ability to do lots of things you can't do effectively in plain HTML.

Description : What would take priority on my website?

Last Answer : I think, for design, the portfolio is more important.

Description : How can I get a color scheme with lots of colors?

Last Answer : I doubt that you can get 20 colors that are going to look distinct enough from one another to be obviously different (especially if they are filling small areas) in the eyes of the average viewer. You may have to use texture differences as well.

Description : Could you give me feedback on a website?

Last Answer : answer:Rather than comment on the site's concept, I'll give you some minor things I noticed: - Some of the quotes have sources. Others don't. I would make the source a requirement. - I had a ... to my avatar. I'm assuming this means that I can follow myself. Anyway, those are some initial thoughts.

Description : Building a site in "Google Sites?"?

Last Answer : Ouch. I thought Google had abandoned this back in 2008. It actually does look abandoned. But you don't need me to come in here and tell you to use Wordpress because you've already told us not to. ... one of those times you either convince the client that it is a bad idea, or walk away. Sorry.

Description : Why do some websites automatically reload soon as they open?

Last Answer : I don’t see either of those sites reload when I use Firefox or Chrome.

Description : Know any websites that serve the same content successfully on big desktop monitors and on hand-held devices?

Last Answer : answer:None spring to mind, but I’m curious if others have encountered such sites. It’s an interesting concept, and you could probably make a mint if you build such a service! We’re an OSX/iOS household, if you need beta testers.

Description : What's the best way to redesign and test a website's CSS that you don't control?

Last Answer : Turn your own machine into a webserver. http://www.apachefriends.org/en/xampp.html

Description : Why do websites always want you to take a survey or give them feedback?

Last Answer : To get your email address.

Description : What are the requirements for supporting millions of users on your website?

Last Answer : Supporting in what? Can you maybe add some detail?

Description : What is a flowchart?

Last Answer : Here is a complete tutorial on flow charts.

Description : Why can't I get favicon.ico to show up as my website tab and bookmark icon?

Last Answer : answer:Excuse me for only reading the last sentence of your detailed question, but they are the black and white things which, after you pressed them, will make that a variety of sounds will ... to the correct position on your computer like C/poison/images/website instead of C/poison/music/website?

Description : A free image hosting service that won't re-size or lower the quality of my images?

Last Answer : answer:Google's Picasaweb https://picasaweb.google.com/home As well as allowing full-scale uploads, it will do on-the-fly resizing for you. For example, I uploaded this photo once, but ... . Conversely, if you move things around on your drive, Picasa automatically and instantly reflects the changes.

Description : What resource or service would you like to be able to find online for free?

Last Answer : answer:A real certified IQ test, made by, like, Stephen Hawking or something. A website akin to Wikileaks for disgraced politicians, where we get to see exclusives on their latest illegalities and such A site ... people I think. Or maybe they have something like this already, that I don't know of.

Description : What are the most common age groupings on sign-up forms?

Last Answer : answer:Under 16 16–18 18–21 21–35 35–50 50–75 Over 75 Although I have to admit I picked these numbers at random.

Description : Why do websites constantly redesign their site?

Last Answer : answer:In response to some anonymous feedback? They do this with the website for the organisation I work for. Drives me doolally. Just get used to where everything is and Bam.. new site and things have ... have to guess they haven't got it right yet. Keeps web design people in work too I guess.

Description : Is there somewhere I can download the iPhone map location gif?

Last Answer : Even if you do find one you’ll get your ass sued right off you. Don’t try to copy other peoples materials.

Description : Whats a good prototyping tool for designing Web Layouts?

Last Answer : answer:Huh? Why not just produce photoshop templates? Proof in PDF. Ask ETPro… he knows more than I.

Description : Best Open Source Web Software for a small book club?

Last Answer : answer:It's not exactly lightweight, but Drupal can certainly handle all those things and much more. I usually recommend Drupal for things like this because it has a good combination of user-friendliness ... or Rails. Cue framework fanatics flaming for daring to compare their babies to a mere CMS.

Description : What is the proper name for "notification bars" in web design?

Last Answer : answer:Are you talking about a comfirmation pop-up message? Generally, when you're doing your use cases for a site, you would document the happy path actions of the user first, and account ... flow. Create the use case from that, and write your error messages or confirmation messaging from that.

Description : Can I build a store-locator page in Dreamweaver CS 5?

Last Answer : answer:Are you looking to take someones zip code and tell them where the closest store is? That is going to tricky to do well. Would using Google Maps to plot the store locations be enough? That is about 100 times easier.

Description : Can an Adsense ad unit move on a page?

Last Answer : Yes, but without specific details, I can’t give a more specific answer.

Description : How to make a website like youtube?

Last Answer : Money. And, lots of it.

Description : What can I do to make my site better?

Last Answer : answer:This is just a look at the design and there are some points where you could improve: Your menus are really nice, the social networking integration is well done too. I like the layout of the ... , good layout etc. most of my points are just nit-picking and tweaks/ error debugging. Good luck!

Description : What's a good, free and classy, site for hosting a single page site?

Last Answer : Google Sites might meet your requirements, although I don’t like it myself. But it is easy and simple enough.

Description : Can you give me advice on finding someone to make my website?

Last Answer : answer:I may be interested, Between me and my partner we can do quite a lot of things, from HTML and CSS to flash and PHP. It depends on the project too, we have our own things that we work ... only pay after work is completed. Some people will want a deposit, but never pay for work until its done.

Description : How to make a website like youtube?

Last Answer : Money. And, lots of it.

Description : Podcasting ... easy or hard?

Last Answer : Are you wondering about the technical aspects of how to set up a podcast site, how to generate/record the content, or more general questions about what makes a podcast good?