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.

How to make a banner to have a little distance between them?

View previous topic View next topic Go down

Solved How to make a banner to have a little distance between them?

Post by smurfavr on October 27th 2015, 11:13 am

@Ange Tuteur
How to make a banner to have a little distance between them?

Code:
<script type="text/javascript">(function() {
  var _randomImages = [
    'http://линк към изображението',
    'http://линк към изображението'
  ], _randomURLs = [
    'http://линк към сайт',
    'http://линк към сайт'
  ];
 
  function _randomImage() {
    var index = Math.floor(Math.random() * _randomImages.length),
        img = _randomImages[index],
        url = _randomURLs[index];
   
    _randomImages.splice(index, 1);
    _randomURLs.splice(index, 1);
    return '<a href="' + url + '" target="_blank"><img src="' + img + '"/></a>';
  };
 
  document.write('<div id="randomBanner">' + _randomImage() + _randomImage() + '</div>');
}());</script>


Last edited by smurfavr on October 27th 2015, 11:36 am; edited 1 time in total

smurfavr
Active Poster

Male Posts : 1413
Reputation : 10
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner to have a little distance between them?

Post by Ange Tuteur on October 27th 2015, 11:19 am

Hi @smurfavr,

Find this part :
Code:
'<div id="randomBanner">' + _randomImage() + _randomImage() + '</div>'

and replace it by :
Code:
'<div id="randomBanner">' + _randomImage() + '&nbsp;' + _randomImage() + '</div>'

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to make a banner to have a little distance between them?

Post by smurfavr on October 27th 2015, 11:36 am

Thanks Ange Tuteur.

smurfavr
Active Poster

Male Posts : 1413
Reputation : 10
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner to have a little distance between them?

Post by brandon_g on October 27th 2015, 11:55 am

Topic solved and archived ~ brandon_g


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5344
Reputation : 488
Language : English
Location : USA

http://broadcastingduo.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