|
I have a personal website that I wanted to post my travel pictures on. Instead of making a slidehow I thought it would be easier to just have all the pictures as thumbnails and then have the user click on a picture they wanted to see. The picture clicked on would then display in a larger size. I found this website that has a zoom feature that does exactly what I want. Unfortunately I do not know how to make the javascript work. I have tried downloading the mootools file and the script file from the website, but I do not know where to put the variable declaration (var myZoomer = new ByZoomer(options) on my page and what exactly it does since I do not see it being used anywhere. Any help would be appreciated.
|
# ? Sep 6, 2009 19:02 |
|
|
# ? Apr 23, 2024 20:21 |
|
Jose Cuervo posted:I have a personal website that I wanted to post my travel pictures on. Instead of making a slidehow I thought it would be easier to just have all the pictures as thumbnails and then have the user click on a picture they wanted to see. The picture clicked on would then display in a larger size. You can see where they initialize their object in this separate .js file. To use it, it looks like you mark some elements in your HTML with a class name or ID. After the document is finished loading, you create their ByZoomer object and pass it this identifier. It will crawl over the document and discover the element you want and then work its magic.
|
# ? Sep 6, 2009 22:07 |
|
Outlaw Programmer posted:You can see where they initialize their object in this separate .js file. This is what I have on the page I am trying to get this to work on: code:
Thanks for the help thus far. Jose Cuervo fucked around with this message at 03:15 on Sep 7, 2009 |
# ? Sep 7, 2009 01:05 |
|
Jose Cuervo posted:I downloaded the four js files and placed them in my www folder and things work just fine now. One quick question though. In the byzoomer_demo.js file it looks like all I need from there is the initialization of the object (new ByZoomer(). Is there any way for me to make this initialization happen by writing the code in my webpage (say in the <head> section? You can just put something similar to this: code:
|
# ? Sep 7, 2009 03:48 |
|
Kilson posted:You can just put something similar to this: Hmm, that does not seem to work. It does not matter too much though. My next question is as follows: On the website he says you can define the following css rule: div#byzoomerTitle: to style the title of large images (appear at the top of the image). How would I use this to have a title appear at the top of my images when zoomed in?
|
# ? Sep 7, 2009 13:05 |
|
I am trying to create a script that will display a random image from an array of 10, wait 30 minutes and then display another image from this array, and on until every image has been displayed. By searching "random image slideshow" I find code that will display random images after a specified delay, but the images will always repeat. Example: The images might show up in the order 3-7-5-1-5-9-3... I need them not to repeat. Once image 3 has been displayed I want it to move on to the next random image and never show image 3 again. Is this possible? Also I would like to set up this slideshow on a webpage where everyone will view the same random slideshow live. I don't want everyone seeing a different random slideshow, but rather that no matter what time you check in on the slideshow you will see the same thing another user sees. Any help would be tremendously appreciated!
|
# ? Sep 7, 2009 18:53 |
|
Other Door posted:I need them not to repeat. Once image 3 has been displayed I want it to move on to the next random image and never show image 3 again. Is this possible? pop it off the array.
|
# ? Sep 7, 2009 18:58 |
|
argz posted:pop it off the array. how? I've tried the splice command with no success.
|
# ? Sep 7, 2009 19:24 |
|
Other Door posted:how? I've tried the splice command with no success. randomize the order of your array, then use pop http://www.w3schools.com/jsref/jsref_pop.asp
|
# ? Sep 7, 2009 19:32 |
|
Not purely a javascript problem, but I am trying to replicate the following function in Visual Basic:code:
|
# ? Sep 7, 2009 19:58 |
|
argz posted:randomize the order of your array, then use pop Thanks a lot! I'll give it a shot!
|
# ? Sep 7, 2009 20:26 |
|
G-Dub posted:Is there an equivalent function to unescape or tostring(16) in VB? And does the ^ symbol mean to the power of, or does it have another use? Apologies for not having a clue. 1) That code is awful, and trying to replicate it in VB will make it at least as awful (probably more so). 2) The entire CharCode function is stupid and unnecessary 3) ^ means bitwise XOR, as the Encrypt function implies. 4) Do you mean VB6 or VB.NET? EDIT: For fun, this is how I'd do that (which requires JS 1.8 but if you aren't using Firefox 3, you don't deserve encryption) code:
Avenging Dentist fucked around with this message at 21:20 on Sep 7, 2009 |
# ? Sep 7, 2009 20:27 |
|
Thanks for your reply. It's VB6. The reason I have to try and replicate that crappy code is because it is part of a login page on a 3rd party which I want to post data to. I'm scraping information out of the site once logged in, but I need to encode the password in their lovely way before posting it to the login page. I was distraught when I saw the process behind it. This is a major company with massive clients too, but yeah this is how they encrypt poo poo.
|
# ? Sep 7, 2009 23:11 |
|
Does anyone know what causes the white screen of annoyance with all flavors of IE7 and Updatepnaels? Once every few dozen callbacks (only from .net update panels, not when done manually), I get the dreaded white screen of annoyance. Basically, an entire frame is white and I need to resize the page or whatever to fix the screen. If I trigger a refresh, it has to be in the appropriate div or frame or the drat thing won't away. edit: There seems to be no pattern as to WHEN it will happen. I'm even talking about completely automated tests - there seems to be no rhyme or reasons as to where or when this may happen. diadem fucked around with this message at 21:54 on Sep 10, 2009 |
# ? Sep 10, 2009 21:16 |
|
Had a fun time today trying to find the bug in my code until I finally distilled the problem down to the following abstraction:code:
code:
I couldn't find this documented anywhere as intended or a bug or anything like that. Am I crazy in thinking this should be a bug/misfeature?
|
# ? Sep 23, 2009 01:51 |
|
Bhaal posted:Had a fun time today trying to find the bug in my code until I finally distilled the problem down to the following abstraction: This is a very, very very common problem. What's happening in your first example script is when you do an onchange, the current value of key is looked up. After your loop runs, the value of key will always be 'oranges' The second example uses a closure to stop that from happening. If you use a library like jQuery, it will do all the dirty work for you. code:
|
# ? Sep 23, 2009 02:08 |
|
Is this hack for IE bad practice for any reason (assume necessary variables exist)? try{ var form = document.createElement("<form action='upload.php' method='POST' name='fileUpload"+fileCount+"' id='fileUpload"+fileCount+"' enctype='multipart/form-data' target = 'frmUpload"+fileCount+"' >"); } catch (err) { var form = document.createElement("form"); form.setAttribute("action", "upload.php"); form.setAttribute("method", "POST"); form.setAttribute("name", "fileUpload"+fileCount); form.setAttribute("id", "fileUpload"+fileCount); form.setAttribute("enctype", "multipart/form-data"); form.setAttribute("target", "frmUpload"+fileCount); }
|
# ? Oct 7, 2009 00:34 |
|
Slasher posted:Is this hack for IE bad practice for any reason (assume necessary variables exist)? Just readability and maintenance, I would think. If you need to change anything about the form, you would have to do it twice. form.action = 'upload.php'; // should work in both IE and Regular Browsers
|
# ? Oct 7, 2009 16:03 |
|
I'd like it to prompt the user (ok/cancel) when clicked, with the messagebox saying "You are leaving example.com. We are not responsible for the content of external sites:\n---\n(the href="")\n---\nPlease make sure this link does not look like phishing,etc" All external links are class="outbound" and can be modified with onclick/etc. Is there an easy way to do this?
|
# ? Oct 10, 2009 21:03 |
|
jQuery:code:
|
# ? Oct 10, 2009 21:44 |
|
Edit: forgot it's href's onclick, so just return the confirm like ^^^^^code:
|
# ? Oct 10, 2009 21:44 |
|
I'm trying to do a little work for my buddies site, and teach myself JS at the same time. Running into a snag though with one little form. Basic set up of the form is like this: Enter Username:_______ (which is checked by if/else if for correct length) Enter Email: ________ Verify Email: _______ Not having any problem with the username, but rather with verifying the email addy. I know ill have to create a function and then i'm assuming if statements where Email = verify email. But i'm not exactly sure how to start it. I've tried googleing it, but not luck. If someone could give me a quick example of something like this i'd appreciate it. in case this makes a diff, here is the code of the username verification function checkInput(usernameId) { var usernameValue = document.getElementById(usernameId).value; alert("username is : " + usernameValue); if (usernameValue.length < 4) { alert("the username is too short"); } else if (usernameValue.length > 8) { alert ("the username is too long"); } else { alert("the username is ok"); } Sointenly fucked around with this message at 18:55 on Oct 11, 2009 |
# ? Oct 11, 2009 18:53 |
|
I recommend that you not bother trying to do that yourself and instead use jQuery with the validation plugin. It's dead simple and looks impressive on the page, too.
|
# ? Oct 11, 2009 18:55 |
|
Word, ill deff look into that. but i'd still like to know how to just code that out as is, it seems like it should be pretty simple... and i'd just like to know for my own knowledge.
|
# ? Oct 11, 2009 19:01 |
|
Sointenly posted:I'm trying to do a little work for my buddies site, and teach myself JS at the same time. Running into a snag though with one little form. I'd use a regex for the email, like so: code:
|
# ? Oct 11, 2009 19:16 |
|
actually, all im really concerned with right now is making sure that the two emails that are entered are the same. after the username is entered, and the email is entered twice, the user presses a submit button which tests everything against the constraints. i know it may sound kind of counter productive... but all i need to know how to do is once the button is clicked, to check and see if both emails match... not really worried about the format of the email addy at this time.
|
# ? Oct 11, 2009 21:49 |
|
sorry, I misunderstood:code:
|
# ? Oct 11, 2009 22:00 |
|
golgo13sf posted:
Sick, thank you! one last thing though, this is my HTML for the button used in the form... i initially wrote it to do the username verification. <input type="button" value ="checkIt" onclick = "checkInput('username');" /> do i need to make any changes to the html so that it will check email as well? thank you Sointenly fucked around with this message at 22:34 on Oct 11, 2009 |
# ? Oct 11, 2009 22:27 |
|
golgo13sf posted:sorry, I misunderstood: I actually came here to ask about this very problem as I'm having some trouble with differences between IE & Firefox. This is the code I've got: code:
The page I'm trying to get it working on is here (yeah go ahead and mess about if you want. It will send out an e-mail with a random password but there's nowhere to login yet): http://nickjwilliams.co.uk/cms/l-administrators.php
|
# ? Oct 11, 2009 23:13 |
|
Sointenly posted:Sick, thank you! I tend to make one function as a wrapper for all my verification functions, kind of like this: code:
code:
|
# ? Oct 12, 2009 00:30 |
|
Daedleh posted:I actually came here to ask about this very problem as I'm having some trouble with differences between IE & Firefox. This is the code I've got: Found it, change the "name" property of your username input tag, right now it's: code:
Just-In-Timeberlake fucked around with this message at 01:03 on Oct 12, 2009 |
# ? Oct 12, 2009 00:36 |
|
golgo13sf posted:Found it, change the "name" property of your username input tag, right now it's: Thank you
|
# ? Oct 12, 2009 06:55 |
|
Im sorry, i don't mean to ask you to code my entire page... im still having problems linking everything together. Let me just show you everything i'm working with and maybe you can show me how to put everything together. Doing everything in Visual Studio, I have an HTML file and a JS file. The HTML for the structure of the input boxes and the check button is: code:
code:
|
# ? Oct 12, 2009 07:21 |
|
Sointenly posted:
If you're asking how to get both javascript functions to fire from your button input, you can: Add another statement to your onclick like: code:
Or wrap them in one function that calls both: code:
code:
Kekekela fucked around with this message at 09:12 on Oct 12, 2009 |
# ? Oct 12, 2009 08:38 |
|
acht! can you spot where I'm loving up here HTML code:
code:
Sointenly fucked around with this message at 01:28 on Oct 13, 2009 |
# ? Oct 13, 2009 01:26 |
|
Sointenly posted:acht! can you spot where I'm loving up here 1. All that stuff under the "checkemail();" line should be in a function called checkemail. 2. Modify the checkInput function to return a boolean indicating success/failure. 3. Check the return values of checkInput and checkemail from within the wrapper function to determine whether or not to display the success message. 4. (optional for consistency) You don't really need to pass the name of the username textbox in as a parameter, you can just hardcode it like you're doing in the email example.
|
# ? Oct 13, 2009 02:19 |
|
Sointenly posted:acht! can you spot where I'm loving up here code:
If you're dead set on a "success" alert on this page, stick it right before the "return true;" in the "validateForm();" function. Just-In-Timeberlake fucked around with this message at 02:25 on Oct 13, 2009 |
# ? Oct 13, 2009 02:20 |
|
golgo13sf posted:
he wants all of the JS done via external file, does much change if i move everything out of the HTML?
|
# ? Oct 13, 2009 02:38 |
|
Sointenly posted:he wants all of the JS done in an external file and then linked, does much change if i move everything out of the HTML and into a separate .JS file?
|
# ? Oct 13, 2009 02:40 |
|
|
# ? Apr 23, 2024 20:21 |
|
Sointenly posted:he wants all of the JS done via external file, does much change if i move everything out of the HTML? Nope.
|
# ? Oct 13, 2009 02:58 |