Forum Moderators: not2easy
<?php include_once "./pictures/cpmfetch/cpmfetch.php";$objCpm = new cpm('./pictures/cpmfetch/cpmfetch_config.php');$objCpm->
cpm_viewRandomMediaFrom("album=lastup",2,4); $objCpm->cpm_close(); ?>
And I have the following CSS code to add opacity to image borders
<DIV align="center"><div style="width:300px;height:200px;background:url(http://www.example.com/images/calla.jpg) repeat;border:1px solid white;"><div style="width:280px;height:180px;border:10px solid white;filter:alpha (opacity=50);-moz-opacity:.50;opacity:.50;-khtml-opacity: 0.5;"></div></div></DIV>
I have been trying for so long to apply the CSS code to the PHP code, but dont know how. Any help plz?
[edited by: tedster at 8:20 am (utc) on Oct. 13, 2008]
[edit reason] use example.com in code [webmasterworld.com] [/edit]
You have a few options:
I am so close to finding the solution, but still not there yet. So frustrating. Basically the opacity is being applid to the pictures, but when hovered, the original image colors are not restored.
I have already applied this to another page, but that one is easy because it is straightforward links. This howvere is a PHP script so it is a little harder.
This is how I have applied this:
<td class="opacityit" width="66%" height="130" valign="top" colspan="4" align="center">
<p align="center">
But still, only one state is working, while the other is not (hovering to get the original image with colors)
Any help would be greatly appreciated.
Thanks a lot,
Since you'll be hovering over a <td>, you do know that IE6 will not support that without some help from javascript ? IE7.js will fix this among many other things.
All other browsers should do fine.
php might be an extra layer in it all, but in essence php generates server-side html that is sent to the browser: it becomes a two step process:
This is what I have:
.opacityit img{
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);
-moz-opacity: 0.4;
}
.opacityit:hover img{
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
-moz-opacity: 1;
}
Again, the opacity works, but hovering doesn't work (i.e the original image is not restored when mouse is on top of it)
Thanks a lot
Take a look at the source code your browser gets (view source ...). Somewhere there's going to be enough of a difference to explain it.
If the html you have applies the class opcaityit to an anchor ( an <a> tag) and you're using IE6 and the generated html uses the class on a table cell (a <td> tag): This is expected behavior: IE6 doesn't support hover anything but <a> tags.
Otherwise it's unexpected for me unless there's something strange going on.
Try to capture the generated html with "view source" and put it in a static html file, that way you can change and simplify it without having to code php. It'll not solve the problem, but it'll bring understanding of the problem that leads to the solution.
Side note: I'd put the filter proprietary IE statements in a conditional comment, but don't worry too much about that now.