I am trying to scroll to an element within an HTML5 object like so:
HTML with angular:
<a href="" ng-click="gotoAnchor(5)">SHOW ME</a>
This is the object I am using to pull in an html file locally.
<object type="text/html" data="sample.html" id="site-frame">
Inside sample.html, I have a div at the bottom of the page:
div id="anchor5" class="anchor">Anchor 5 of 5</div>
function within controller:
$scope.gotoAnchor = function(x) {
var newHash = 'anchor' + x;
if ($location.hash() !== newHash) {
$location.hash('anchor' + x);
} else {
$anchorScroll();
}
};
if I place the anchor5 div outside of the object, it works, but not while inside the of the object. I am looking to go INTO the Object and scroll to the div. Any help would be awesome!