Monday, November 14, 2011

FMP Script Loop

Go to Record/Request/Page [First]
Loop
    If [field = whatever]
        Omit Record
        If [Get (FoundCount) = 0]
            Exit Loop If [1]
        End If
    Else
        Go to Record/Request/Page [Next; Exit after last]
    End If
End Loop

Wednesday, October 5, 2011

drop shadow frames

I've always been picky about how images are displayed on my sites, so I'm constantly looking for new ways to frame them, size them, spruce them up. It's the artsy-fartsy side of me; I can't help it.

In the beginning, of course, I was lucky just to be able to get the damn things to appear properly. But once I got that under control, I started fretting over just how tacky a plain, unaccented image can look on a website. I explored a number of "frames" and for a while I was pleased with an understated outset border.

But then I was looking at the way images are previewed in Windows Explorer and was admiring the drop shadow, so I did some digging and here's what I found:


<img class="drop" src="img.jpg" />

img.drop {
        box-shadow: 5px 5px 10px #D2D2D2;
}
Which looks something like this...


The breakdown is like this:
  • first pixel count = x-axis off-set
  • second pixel count = y-axis off-set
  • third pixel count = blur distance
  • color = color of shadow (d'uh)

Thursday, September 22, 2011

centering a series of images

This took me for-freaking-ever to figure out. I don't understand why seemingly simple solutions (like align="center") never freaking work the way I expect them to, damn it.

Anyway, I wanted to horizontally center two images side by side, without using a table. (I hate tables. They're terribly useful, but they're such mountains of code. And the site I'm working within has stupid formatting for them.) Nothing seemed to work until I put them in a paragraph and used this display:block thingie...


.center {
display:block;
margin-left:auto;
margin-right:auto;
}


<p class="center" align="center">
<a href="site/pic.jpg" target="_new">
<img src="site/pic.jpg" style="width:47%; box-shadow:5px 5px 15px #D2D2D2; margin:1.25%; padding:0;" />
</a>

<a href="site/pic2.jpg" target="_new">
<img src="site/pic2.jpg" style="width:47%; box-shadow:5px 5px 15px #D2D2D2; margin:1.25%; padding:0;" />
</a>
</p>


And I finally got them to show up like this...


Ta-da!