PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Highlight an Image

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Highlight an Image

    When using highlighting, is it possible to highlight an image with a border if the search term was found the the ALT text of an image? As far as I can tell highlighting only works with text on the page.

    A smiple idea would be if the code was:
    Code:
    <a href="#">
    <img src="image-15.jpg" alt="On the beach with friends">
    </a>
    Searching for "beach" would highlight the image like:
    Code:
    <a href="#">
    <img style="border:5px solid #ffff00;" src="image-15.jpg" alt="On the beach with friends">
    </a>
    Of course my situation is a bit more complex. My code pops up the image with a caption when clicked.

    It would start as:
    Code:
    <a href="#">
    <img src="image-15.jpg" title="Click to enlarge">
    </a>
    <div class="caption">On the beach with friendso</div>
    And need to rewrite as:
    Code:
    <a href="#">
    <img style="border:5px solid #ffff00;" src="image-15.jpg" title="Click to enlarge">
    </a>
    <div class="caption">On the beach with friendso</div>
    I'm sure there are many ways to highlight an image. I'm just using "style" as an example.

  • #2
    An image could be returned in the search results either from internal meta data (keywords stored inside the image file) or external meta data (like the ALT text in the HTML as mentioned above). In the case of internal meta data, the highlight script would have no knowledge of what words are inside the image file and this would not be possible.

    In the case of external meta data like ALT text, technically it is possible, but would require significant changes in the highlight script to do so. It is not currently in our list of things to do but we may consider it if there is more user demand.

    Comment

    Working...
    X