[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

random ad js spacing

super70s

2/17/2015 1:42:00 AM

I'm trying to get some control over the horizontal spacing between the
images in this random ad js, I was wondering if anyone knew how to do it
(if it's possible) (I just need to add 2 pixels of spacing between the
images):


<head>
.imgBorder {
border: none;
}
img.hover:hover {border:2px solid #005D5F;}
</style>

<script type="text/javascript" src="randomAds.js"></script>
</head>


<script type="text/javascript">
randomorder(adblock, ' ')
</script>



randomAds.js file:


var adblock=new Array()
adblock[0]='<a href="_______.html"><img class="hover"
src="http://www.___.com/image1... class="imgBorder"></a>'
adblock[1]='<a href="_______.html"><img class="hover"
src="http://www.___.com/image2... class="imgBorder"></a>'
adblock[2]='<a href="_______.html"><img class="hover"
src="http://www.___.com/image3... class="imgBorder"></a>'
adblock[3]='<a href="_______.html"><img class="hover"
src="http://www.___.com/image4... class="imgBorder"></a>'
adblock[4]='<a href="_______.html"><img class="hover"
src="http://www.___.com/image5... class="imgBorder"></a>'

function randomorder(targetarray, spacing) {
var randomorder=new Array()
var the_one
var z=141
for (i=0;i<targetarray.length;i++)
randomorder[i]=i

while (z<targetarray.length) {
the_one=Math.floor(Math.random()*targetarray.length)
if (targetarray[the_one]!="_selected!"){
document.write(targetarray[the_one]+spacing)
targetarray[the_one]="_selected!"
z++
}
}
}
6 Answers

yoker

8/1/2010 10:37:00 AM

0

On Aug 1, 1:10 am, "Sweetbac" <sweetb...@scbglobal.net> wrote:
> "yoker" <yoke...@yahoo.com> wrote in message
> >A male child was born in San Francisco, California USA,
> > learned to play the guitar as a teen he also learned banjo,
> > also learned to paint as an artist,
> > found the guitar to be his meal ticket and became very
> > successful with the help of some friends...
>
> > I miss that man .... Jerry Garcia of the Grateful Dead.

>
> ...And that man is none other that Frank Marino.
> Nice post.
>
>
Which one?

Frank Marino (Francesco Antonio Marino), born November 20, 1954, in
Montreal, is the guitarist and leader of Canadian hard rock band
Mahogany Rush.

or

Frank Marino (born 1965 in Brooklyn, New York) is a female
impersonator dubbed Ms. Las Vegas for his longtime starring role as
Joan Rivers in the Las Vegas drag revue Frank Marino's Divas Las
Vegas, playing at the Imperial Palace Hotel and Casino on the Las
Vegas Strip. Famous for his lavish on-stage wardrobe (much of which
was designed by Bob Mackie, who has also done fashions for Rivers),
Marino has received two Las Vegas Walk of Fame stars and received
another star as well as having a street named after him when Las Vegas
Mayor Oscar Goodman honored his hard work and commitment to the Las
Vegas performance world with "Frank Marino Day" on February 1, 2005.

or

Frank (Francis) Marino born August 1, 1942 in Allentown, Pennsylvania
USA and died August 8, 1995 in Reykjavik, Iceland. An economist that
enjoyed playing guitar.



yoker

8/1/2010 10:43:00 AM

0

On Aug 1, 1:16 am, marcman <marcmanstud...@gmail.com> wrote:
> On Aug 1, 1:10 am, "Sweetbac" <sweetb...@scbglobal.net> wrote:
>
> > "yoker" <yoke...@yahoo.com> wrote in message
> > >A male child was born in Manitoba, Canada
> > > learned to play the guitar as a teen he also learned banjo,
> > > also learned to paint as an artist,
> > > found the guitar to be his meal ticket and became very
> > > successful with the help of some friends...
>
> > > I miss that man ....
>
> > ...And that man is none other that Frank Marino.
> > Nice post.
>
> Only Jer' could nail it in a five second video clip.
>
> http://www.youtube.com/watch?v=G...


http://www.youtube.com/watch?v=1bmbUCd7XV...

http://www.youtube.com/watch?v=--gNlvIgkeg&featu...

Michael Haufe (\"TNO\")

2/17/2015 4:21:00 AM

0

On Monday, February 16, 2015 at 7:41:49 PM UTC-6, super70s wrote:
> I'm trying to get some control over the horizontal spacing between the
> images in this random ad js, I was wondering if anyone knew how to do it
> (if it's possible) (I just need to add 2 pixels of spacing between the
> images):
>
>
> <head>
> .imgBorder {
> border: none;
> }
> img.hover:hover {border:2px solid #005D5F;}
> </style>
>
> <script type="text/javascript" src="randomAds.js"></script>
> </head>
>
>
> <script type="text/javascript">
> randomorder(adblock, ' ')
> </script>
>
>
>
> randomAds.js file:
>
>
> var adblock=new Array()
> adblock[0]='<a href="_______.html"><img class="hover"
> src="http://www.___.com/image1... class="imgBorder"></a>'
> adblock[1]='<a href="_______.html"><img class="hover"
> src="http://www.___.com/image2... class="imgBorder"></a>'
> adblock[2]='<a href="_______.html"><img class="hover"
> src="http://www.___.com/image3... class="imgBorder"></a>'
> adblock[3]='<a href="_______.html"><img class="hover"
> src="http://www.___.com/image4... class="imgBorder"></a>'
> adblock[4]='<a href="_______.html"><img class="hover"
> src="http://www.___.com/image5... class="imgBorder"></a>'
>
> function randomorder(targetarray, spacing) {
> var randomorder=new Array()
> var the_one
> var z=141
> for (i=0;i<targetarray.length;i++)
> randomorder[i]=i
>
> while (z<targetarray.length) {
> the_one=Math.floor(Math.random()*targetarray.length)
> if (targetarray[the_one]!="_selected!"){
> document.write(targetarray[the_one]+spacing)
> targetarray[the_one]="_selected!"
> z++
> }
> }
> }

use a margin?

super70s

2/17/2015 6:18:00 AM

0

In article <7e73da6b-573e-4353-be34-0a36f14621f8@googlegroups.com>,
"Michael Haufe (TNO)" <tno@thenewobjective.com> wrote:

> use a margin?

I'm trying to put a little more space in between the images, I have them
centered and just want to fill out the space.

I could put a little more blank space on the sides of each image, but
that would be a huge hassle because I actually have 150 random images to
draw from (this isn't for advertisements, it's 8 random pics of 150
celebrities and I just shortened it to 5 images to simplify it for the
question in here).

It may not even be possible to indicate more spacing in the js code.

Michael Haufe (\"TNO\")

2/17/2015 7:36:00 AM

0

On Tuesday, February 17, 2015 at 12:17:48 AM UTC-6, super70s wrote:
> "Michael Haufe (TNO)" wrote:
>
> > use a margin?
>
> I'm trying to put a little more space in between the images, I have them
> centered and just want to fill out the space.
>
> I could put a little more blank space on the sides of each image, but
> that would be a huge hassle because I actually have 150 random images to
> draw from (this isn't for advertisements, it's 8 random pics of 150
> celebrities and I just shortened it to 5 images to simplify it for the
> question in here).
>
> It may not even be possible to indicate more spacing in the js code.

Why won't the following or similar be sufficient in the CSS?

..whatever a{
margin: 0 1px;
}

Dr J R Stockton

2/18/2015 12:53:00 PM

0

In comp.lang.javascript message <super70s-0847BE.19414116022015@bonxibon
..datemas.de>, Mon, 16 Feb 2015 19:41:41, super70s
<super70s@super70s.invalid> posted:

>I'm trying to get some control over the horizontal spacing between the
>images in this random ad js, I was wondering if anyone knew how to do it
>(if it's possible) (I just need to add 2 pixels of spacing between the
>images):

The simple-minded crude, minimum-learning way would be to create a black
image 2px wide and use an editor's multi-replace to put that where you
want your 2px gaps. When correct, change black to blank.


--
(c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.... - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)