Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple Site Help

Featured Replies

Hi there,

 

I'm a photographer who has some knowledge of web design. I'm looking to create a website to display my work. I'm really liking this site http://www.jasonevans.info/ but am unsure how to crate one similar. I'd like my images to move around when the page is shrunk/stretch as well as having the randomise button at the bottom of the page. Could anyone explain to to create ese? or how the person who created the jason evans site did it?

 

any help would be really appreciated!!!

 

Inamoto

Edited by INAMOTO

They have added this javascript...

 

<script type="text/javascript">

//<![CDATA[
var totalPics = 754;
var numRandPics = 30;
var imgFolder = 'images/';
//load the paths to the pics
var picPaths = new Array();
for(var i=0; i < totalPics; i=i+1) {
picPaths[i] = imgFolder+'Jason_Evans_'+(i+1)+'.jpg';
}
//display the random images
var randNums = new Array();
window.onload=function() {
var randNum;
var picO = new Array(); //store the preloaded images
//generate unique random numbers and display their pics
for(var i=0; i < numRandPics; i=i+1) {
do {
randNum = Math.floor(Math.random()*picPaths.length)
} while(is_in_array(randNum)); //this number already used - so generate another.
randNums.push(randNum); //store the random numbers used so far
//preload the random image
picO[i] = new Image();
picO[i].src = picPaths[randNum];
//create the <img> for this pic
imgElem = document.createElement("img");
imgElem.setAttribute("src", picO[i].src);
imgElem.setAttribute("alt", '');
imgElem.setAttribute("class", 'wallPics');
document.getElementById("container").appendChild(imgElem);
}
}
//helper function
function is_in_array(num) {
var isNumInArray = false;
for(var i=0; i < randNums.length; i=i+1) {
if(num == randNums[i]) {
isNumInArray = true;
i = randNums.length;
}
}
return isNumInArray;
}
//]]>
</script>

 

...to the <head> of the page, then added loads of images to a folder called "images" (without quotes).

 

Then added a refresh button to the bottom of the page.

Edited by Bomb

  • Author

hey thanks a lot! you're a great help! Do you have an idea how to create the refresh button?

 

much appreciated!

I would add some text though, i find the site very uninspiring and does not do the images justice.

 

Who are you, what do you do and why, these are important bits of info.

hey thanks a lot! you're a great help! Do you have an idea how to create the refresh button?

 

much appreciated!

This is how it was achieved on the example site. Add this where you want the button to appear...

 

<a href="javascript:history.go(0)"><img alt="more" src="url of your image"></a>

 

Obviously changing the url of your image.

Edited by Bomb

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.