The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Code isn't working

5 posters

Go down

Code isn't working Empty Code isn't working

Post by Kamui March 2nd 2016, 12:12 pm

Hey, I'm trying to use this code but it isn't working at all for my forum.

Code:

<!-- style of the widget -->
<style type="text/css">#mainBlock { height:150px } /* height of the main image block */
#staffList { text-align:center; }
#staffList a img {
  border-radius:100px;
  width:50px;
  height:50px;
}</style>
 
<!-- the staff list -->
<div id="staffList">
  <div id="mainBlock">
    <img id="mainImage" src="http://2img.net/i/bl/logo.png" /> 
 </div>
  <a href="/u1">
    <img src="http://i56.servimg.com/u/f56/18/45/41/65/rose_a10.png" alt="http://i59.servimg.com/u/f59/18/45/41/65/rose_210.png" />
  </a>
  <br />
  <a href="/u2">
    <img src="http://i56.servimg.com/u/f56/18/21/60/73/noavaf10.png" alt="http://2img.net/i/fa/admin/icones/help.png" />
  </a>
</div>
   
<!-- technical stuff -->
<script type="text/javascript">(function() {
var img = document.getElementById('staffList').getElementsByTagName('IMG'), main = document.getElementById('mainImage'), def = main.src,i;
for (i=0; i<img.length; i++) {
  if (!/mainImage/.test(img[i].id)) {
    img[i].onmouseover = function() { main.src = this.alt }
    img[i].onmouseout = function() { main.src = def }
  }
}
})();</script>
Kamui
Kamui
Forumember

Male Posts : 291
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by TheCrow March 2nd 2016, 1:05 pm

Kamui wrote:Hey, I'm trying to use this code but it isn't working at all for my forum.

Code:

<!-- style of the widget -->
<style type="text/css">#mainBlock { height:150px } /* height of the main image block */
#staffList { text-align:center; }
#staffList a img {
  border-radius:100px;
  width:50px;
  height:50px;
}</style>
 
<!-- the staff list -->
<div id="staffList">
  <div id="mainBlock">
    <img id="mainImage" src="http://2img.net/i/bl/logo.png" /> 
 </div>
  <a href="/u1">
    <img src="http://i56.servimg.com/u/f56/18/45/41/65/rose_a10.png" alt="http://i59.servimg.com/u/f59/18/45/41/65/rose_210.png" />
  </a>
  <br />
  <a href="/u2">
    <img src="http://i56.servimg.com/u/f56/18/21/60/73/noavaf10.png" alt="http://2img.net/i/fa/admin/icones/help.png" />
  </a>
</div>
   
<!-- technical stuff -->
<script type="text/javascript">(function() {
var img = document.getElementById('staffList').getElementsByTagName('IMG'), main = document.getElementById('mainImage'), def = main.src,i;
for (i=0; i<img.length; i++) {
  if (!/mainImage/.test(img[i].id)) {
    img[i].onmouseover = function() { main.src = this.alt }
    img[i].onmouseout = function() { main.src = def }
  }
}
})();</script>
Hello,

Could you please explain to us what exactly you are trying to do, what this code is for, what is the result of it and how you want this to look like?
And please tell us if the information for your forum on your profile are correct for the link and the forum version.

Thanks.


Code isn't working Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by Kamui March 2nd 2016, 1:09 pm

This is a gif of the code, I basically want to learn how to manipulate it more but it seems to not be working on my forum when I place the code in. @Luffy

FORUM LINK http://narutogaiden.forumotion.com/

Code isn't working Ec41016b360bf3a7c40c7d6f627ecb09
Kamui
Kamui
Forumember

Male Posts : 291
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by Van-Helsing March 2nd 2016, 1:40 pm

Hello,
I can't see your widget on your forum.
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by Pebbles March 2nd 2016, 1:48 pm

like i said in your other topic
Pebbles wrote:
Kamui wrote:@pebbles I think the codes you guys gave me isn't compatible with my forum. I have phpBB2
do you know where to add the javascript? its at modules and then Javascript codes management

and just try and add the above in a new widget
Pebbles
Pebbles
New Member

Posts : 11
Reputation : 5
Language : English

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by Kamui March 2nd 2016, 2:09 pm

I already tried that @pebbles. @Van-Helsing I set up the widget but this is how it looks. http://narutogaiden.forumotion.com/
Kamui
Kamui
Forumember

Male Posts : 291
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by Ange Tuteur March 2nd 2016, 2:11 pm

Make sure that the editor is in Source Code mode. Click the white piece of paper in the editor toolbar so that it is highlighted, and THEN paste the code.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by Kamui March 2nd 2016, 2:35 pm

Okay it worked, another question is. How can I set this type of design up? It's like a pyramid effect, like how can I add the pictures side by side? Also, how can I create some space between the main picture and the smaller ones. I don't want them over lapping.Code isn't working Abcda9a9e2ed0453a260660208fe413f
Kamui
Kamui
Forumember

Male Posts : 291
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

Code isn't working Empty Re: Code isn't working

Post by Kamui March 4th 2016, 4:02 am

Kamui
Kamui
Forumember

Male Posts : 291
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum