Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'area coordinates'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. Hi, This question does not apply directly to this book, so far anyway, but I'm wondering if someone can give me advice on the coordinates for an HTML imagemap area. I have been experimenting with an imagemap with a number of selectable areas defined via the standard map and area tags. Does anyone know if the coordinate values can somehow be adjusted to take account of varying viewport dimensions? The code following works for a selectable area on an image map on my localhost (Windows) PC. But if I change the size of the viewport, the selectable area changes and in some cases disappears altogether. Any advice will be most appreciated and thank you in anticipation. <div> <img src="../images/product_header_test.jpg" title="Image Title" id="product_header_image" usemap="#product_image"> <?php // calculate the coordinate values from the width of the wrapper in pixels // assume screen width of 1920 pixels just for the sake of this exercise // first the 'raw' rectangle coordinates (obtained from 'paint') $top_left_raw_x = 273; $top_left_raw_y = 160; $bottom_right_raw_x = 375; $bottom_right_raw_y = 183; $factor = 1650/1920; // this yields a pretty good answer but was derived at by trial and error $top_left_x = (int) $top_left_raw_x * $factor; $top_left_y = (int) $top_left_raw_y * $factor; $bottom_right_x = (int) $bottom_right_raw_x * $factor; $bottom_right_y = (int) $bottom_right_raw_y * $factor; // this does not work if you resize the screen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! echo <<<EOT <map name="product_image"> <area shape="rect" coords="$top_left_x,$top_left_y,$bottom_right_x,$bottom_right_y" href="$home" alt="Home" target="_self"> </map> EOT;
×
×
  • Create New...