The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Code isn't working

View previous topic View next topic Go down

Code isn't working

Post by Kamui on 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://illiweb.com/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://illiweb.com/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
Forumember

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

http://narutogaiden.forumotion.com/

Back to top Go down

Re: Code isn't working

Post by Luffy on 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://illiweb.com/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://illiweb.com/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.






Luffy
Manager
Manager

Male Posts : 4236
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Re: Code isn't working

Post by Kamui on 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/


Kamui
Forumember

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

http://narutogaiden.forumotion.com/

Back to top Go down

Re: Code isn't working

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

Hello,
I can't see your widget on your forum.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Re: Code isn't working

Post by Pebbles on 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
New Member

Posts : 11
Reputation : 5
Language : English

Back to top Go down

Re: Code isn't working

Post by Kamui on 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
Forumember

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

http://narutogaiden.forumotion.com/

Back to top Go down

Re: Code isn't working

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Re: Code isn't working

Post by Kamui on 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.

Kamui
Forumember

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

http://narutogaiden.forumotion.com/

Back to top Go down

Re: Code isn't working

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


Kamui
Forumember

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

http://narutogaiden.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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