Simulate image click from different frame

I have a button in a frame with id=“leftFrame”

In another frame with id=“mainFrame” on the same page and same domain I have a div that holds and image that activates that div for movement.

How can I simulate that click from the something in the left frame?
I have tried for button in leftFrame:


<div id="admin">
    <img src="images/slideIt.gif" onclick="clickers()"/>
  </div>

function clickers() {
        parent.frames['mainFrame'].document.getElementById('slider').click();
        also tried
        parent.frames[1].document.getElementById('slider').click();
    }

In mainFrame I have:


<a href="#" id="slider"><img src="images/slideleft.gif" alt="slider" title="slider" /></a>

Thanks in advance I can seem to simulate even an alert call in the other frame. Am I accessing it wrong via DOM practices?