p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   CSS Cascading Style Sheets (http://p2p.wrox.com/forumdisplay.php?f=146)
-   -   Clickable background (http://p2p.wrox.com/showthread.php?t=67093)

AbrarNazeer April 2nd, 2008 08:00 AM

Clickable background
 
I want to use following code for Clickable background.

<style type='text/css'>
  BODY { background-image:url('my.aspx?id=001') }
</style>

 where "my.aspx?id=001" will return an image randomly, but i also want this background
 to be clickable (Navigate to my randomly specified Url)
 How is it possible ? Share the Ideas and give me chance of thanks.


planoie April 2nd, 2008 12:15 PM

You could add an onclick handler to the body element. This could do a client-side navigation instruction.

You should consider using a custom handler (ashx) instead of using a regular aspx page for the random image serving. It will be faster because it doesn't have the overhead of the page class.

-Peter
peterlanoie.blog

AbrarNazeer April 4th, 2008 12:30 AM

 Planoie,
   I have already done this task by JavaScript but my Client's requirement is to do via CSS.
   By custom handler (ashx) , How I will make my background clickable (Navigate to speciefied URL) without getting the innerHTML of Requested Page.
   Please guide me regard.

planoie April 8th, 2008 08:51 AM

I haven't created custom handlers myself yet. A google search should yield plenty of help on it though.

I'm not sure what you mean by the second question. If you add a click handler to the body element, it's not going to "get" any HTML, it will just fire whatever javascript is in it. This script will just navigate to the specified page.

-Peter
peterlanoie.blog

AbrarNazeer April 9th, 2008 12:22 AM

Planoie,
        Thanks for ur time again. This task has been hold for some time as I restart the task and found any solution then I ll update you.




All times are GMT -4. The time now is 09:07 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.