|
i wanna ask a question regarding this random image link/sequential image link display issue..i have write out the code and it works, but the problem for me is i dunno how to make the image stop when mouseover the image display..
these are my code, you can test it with ur html and put 3 images with the name specified below....
var interval = 5; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes
interval *= 1000;
var image_index = 0;
var image1 = new imageItem("fheader18.png", "http://imdavidlee.com");
var image2 = new imageItem("fheader19.png", "http://limpek.com");
var image3 = new imageItem("davidlogo.jpg", "http://codebasic.net");
image_list = new Array();
image_list[image_index++] = image1;
image_list[image_index++] = image2;
image_list[image_index++] = image3;
var number_of_image = image_list.length;
function imageItem(image_location, link) {
this.image_item = new Image();
this.image_item.src = image_location;
this.image_item.link = link;
}
function stopImage() {
setTimeout("rotateImage()", NULL);
}
function getNextImage() {
if (random_display) {
image_index = Math.floor(Math.random() * image_list.length);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = image_list[image_index];
return(new_image);
}
function rotateImage(rImage, link) {
var new_image = getNextImage();
document.getElementById('rImage').src = new_image.image_item.src;
document.getElementById('rLink').href = new_image.image_item.link;
setTimeout("rotateImage()", interval);
}
http://codebasic.net
|
|
|
|
|
you could use onmouseover and onmouseout to assign a value to a variable ie.
<img onmouseover="stopplaying()" onmouseout="startplaying()" />
<script>
var isstopped=0;
function stopplaying(){
isstopped=1;
}
function startplaying(){
isstopped=0;
}
function rotateImage(rImage, link) {
var new_image = getNextImage();
if(isstopped == 1){
document.getElementById('rImage').src = new_image.image_item.src;
document.getElementById('rLink').href = new_image.image_item.link;
setTimeout("rotateImage()", interval);
}
.....
}
</script>
|
|
|
|
|
I'm putting together a small site for a photographer, and she would like a menu/thumbnail set of photo categories inside of a photo-film style border. I'm very new to the graphics etc. side of these things, so, any advice on my course of work will be appreciated. My first option is to use a background image for each table cell, centering the cell in the image, so only the image borders are visible, giving the appearance of images with film-style borders. This is not efficient, but there aren't many images in the table, so simplicity may win here. My next option is to extract component images and build only the vertical and horizontal parts of the film-style border that are visible around the images. Are there any other options?
|
|
|
|
|
Yes, use one outer div with a set width & a background image that is your film with repeat style set to repeat-y (vertically). Set the internal padding and give the thumbnail images a bottom margin correctly then you can add an unlimited amount of pictures to it. Then whenever you add an image, all you will need to do is make sure they are the right size. No farting around with adding film borders.
This would take longer to set up but is easier to manage afterwards. So, it really does depend how much you are planning to use it.
|
|
|
|
|
Hi, I'm trying to use JavaScript to log key strokes into a log.txt file, or something similar to that. Can anyone steer me in the right direction?
Thanks
|
|
|
|
|
you can not write to client machine using javascript. You can use other technologies such as ActiveX to write to client machines, but they need explicit permission of the user.
|
|
|
|
|
Nikyoro wrote: I'm trying to use JavaScript to log key strokes into a log.txt file
where you want to save the log i.e. on server or client machine.
If client machine, then you need to use ActivX and need client permissions(As Yusuf said)
If server, then use the AJAX to send request and save the strokes in the file
|
|
|
|
|
Hi,
You can use javascript _doPostBack function to forcefully postback and let code-behind do the writing part to the log file. But this may not be a best practice.
Either you love IT or leave IT...
|
|
|
|
|
Hi,
What is the goal of having the alt property in the image tag? When I hover over the image in IE7 then the text displays, in Firefox it does not display. Why is this? And what is a replacement for it?
Regards
|
|
|
|
|
the primamry purpose of alt is to show the text in case the image is not shown, or if image is not supported, such as text only browsers.
In IE, it used as tooltip as well, but that is IE's implementation and it is outside of the intended usage.
for more info see here[^]
|
|
|
|
|
Thanks alot Yusuf
|
|
|
|
|
Another reason for it is so that people who are unable to see the image can mouseover it and recieve an audible description of the image. See "screen readers"
|
|
|
|
|
Hi,
I am developing a donation website and I want to use paypal as the payment method, this is my first time to use paypal as a receiver, so I have a few technical questions:
1. How can I automatically accept payments?
2. How can I programmatically detect that someone has paid "some amount"?
3. I want the user to provide some information with his payment, such as Name, Gender, Country so how can this be done and how can it be linked to the payment??
any help please?
Thanks alot!
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|
|
see if there is any thing on paypal website to answer you question.
|
|
|
|
|
Hi,
answer to your question:
1. You must have a member of paypal and your country must have a paypal unless you have a creadit card that accept paypal payment.
2. If you have a database that detect if someone pay you. But the quickest thing to know if someone paid you, logon to your account in paypal.
3. In your account at paypal.
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
1) You can make buttons in the "merchant" area of the paypal website.
2) You can use ipn and pdt. This is quite a big task so set aside some time - there are free scripts which you can find on paypal & google to help you. Involves using basic sockets.
3) ONce again you can use ipn &/or pdt. Alternatively you can make all the forms on your site and POST the info to Paypal.
IPN = Instant Payment Notification
PDT = Payment Data Transfer
|
|
|
|
|
I have html which contain iframe in it.
I have a button in my html which will call javascript(ajax) function and I will get server response from php script.
Normally if I want to display it in my main html, I can use:
var spantag=document.getElementById("displayCamera");
spantag.innerHTML=xhr.responseText;
How can I display the result into other html file/my iframe(let say I have span id in html of the iframe).
|
|
|
|
|
try window.iframeID.spanID
where iframeID is the id of your iframe and spanID is the id of your span.
|
|
|
|
|
Its done by
window.frames["displayCatalog"].document.getElementById("displayCamera").innerHTML = xhr.responseText;
So I have to change the iframe's attribute to name and not id.
Thanks though for the heads up.
|
|
|
|
|
Dear All
I need your help about fading news in javascript.
Thanks
|
|
|
|
|
Dear Ahmed,
Please describe what you want in detail.
Thanks
|
|
|
|
|
Dear Yusuf
There is a column for news in the website that i am working on, in the past i used to use marquee for news or sliding news but now i want to make it alittle cool and attractive when i searched i found out that fading is fair to have in my website that automatically it disappear and after short time it appear
i found out some codes but they were not working properly.
it will be better to include links that when one message fade in it should be link to a page and the same for others.
if you dont undrestand wht do i mean, plz check here: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=3065&lngWId=2
Thanks
|
|
|
|
|
try jquery or similar frameworks - easier than making your own scripts.
|
|
|
|
|
Hi,
i have an ocx file in webserver and i included it in my html page ..
and when client requests for that html the ocx gets installed with his permission but the issue it"s getting successfully installed on Admin machine..but in non-admin machine even the message box that prompts to install ocx is not displaying.....is there any limitation for non-admin...
pls help me out...
|
|
|
|
|