Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Click here to join us on IRC (#charas on irc.freenode.net)!
Charas-Project
»
Off-Topic
»
All of all!
»
HTMLOLMAO STFU
« previous
next »
Print
Pages: [
1
]
Author
Topic: HTMLOLMAO STFU (Read 1634 times)
X_marks_the_ed
trygtt o sizg msw kisg
Royal
Posts: 4,394
WHAT THE WHY ARE THESE BUTTONS
HTMLOLMAO STFU
«
on:
April 25, 2008, 11:57:41 PM »
I'd post in the HTML forum, but no one goes there anymore.
I'm trying to code an image that when clicked, will change another image to the next one. Basically, a "click me to go to the next page" kinda thing. But not just going to another web page, but instead going to the next image. I think it may be possible through variables, but I'm not that advanced.
If It helps, you can see the page at
. Just go to pages -> story arcs.
Logged
Osmose
So freakin' inactive
Royal
Posts: 3,041
(No subject)
«
Reply #1 on:
April 26, 2008, 03:00:18 AM »
So you want an image that changes as you click a link?
So, given your images are set up like so:
comic1.png, comic2.png, comic3.png, and so on
Try this (Replace pipe characters | with < and > for tags. I'd make the code tag actually work to display them properly but the forum is being evil and I have to go now. Sorry.
The image itself:
|img src="comic1.png" id="comic" /|
Within the head tags for the page, where normal Javascript goes:
|script type="text/javascript"|
var imgNum = 0;
|/script|
The link:
|a href="#" onclick="comicNum++; document.getElementById('comic').src = 'comic' + comicNum + '.png'; return false;"|Click Me!|/a|
I'm too lazy to test it but it should work. If you have problems with it I'll try to test it out myself.
Logged
Hrm.
X_marks_the_ed
trygtt o sizg msw kisg
Royal
Posts: 4,394
WHAT THE WHY ARE THESE BUTTONS
(No subject)
«
Reply #2 on:
April 26, 2008, 01:24:21 PM »
It works, but only because I noticed you must've accidentally typed comicNum instead of imgNum for the rest of the code. o.O
In addition, if I wished to put in story arc shortcuts, how would I go about doing that?
Logged
X_marks_the_ed
trygtt o sizg msw kisg
Royal
Posts: 4,394
WHAT THE WHY ARE THESE BUTTONS
(No subject)
«
Reply #3 on:
April 26, 2008, 02:01:28 PM »
Right. Waiting for flash to load 200 pages of a webcomic.
Bah, rather use HTML. Just don't have everything load at once, only let pages that the visitor wants to read load. :/
EDIT: Nevermind about the story arc shortcuts. Playing around with it, I figured it out.
Logged
Osmose
So freakin' inactive
Royal
Posts: 3,041
(No subject)
«
Reply #4 on:
April 26, 2008, 05:12:29 PM »
Flash is for a specific purpose - movies or games. Using Flash for anything besides that is tawdry in frowned upon. Almost everything that may be "easy" to do in flash is just as easy to do in JS/CSS and will be better done in it anyway.
I use NoScript and one of the most frustrating things to me is having to add an exception for a site that uses flash for a menu or for functionality.
So no, you fail. Let us web designers figure out how to build websites.
Logged
Hrm.
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Off-Topic
»
All of all!
»
HTMLOLMAO STFU