我在这个网站上做东西非常新手,所以我不确定我是否使用了正确的术语-我尝试过用一堆不同的术语/想法/措辞搜索,但我找不到任何东西来帮助我更清楚地提出问题或找到我想要的例子
我有一个img标签,它是一个锚点-点击图像打开一个新页面(不是新标签,停留在原始标签中)
我想打开的下一个页面打开到img标签的确切位置。我试着使用<a id="">, <a href="#id">的东西,但我不确定它是否工作bc通常在<a>中的“文本”实际上是一个<img>
我正在尝试用极其有限的javascript知识创建一个活页书式的文字-我有一些javascript,它让你看起来像是在img本身上“翻页”(只是在y轴上翻转它),但当你点击img转到下一页时,它只会加载到页面的顶部,看起来很混乱(必须向下滚动才能再次看到img,然后再单击)。
包括html/javascript,但如果需要更多信息,请让我知道!
<!--this is the page-flip javascript-->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="../flip-master/dist/jquery.flip.min.js"></script>
<script>
$(function()
$(".flip").flip({
trigger: 'click'});});
</script><main class="flip">
<div class="front">
<img src="../images/sketchbook3.jpg" alt="sketchbook page">
</div> <!--this is where i would like the page to open to upon loading,
the idea being clicking on the page "opens" to the next page, until the end
of the "book" . each flip is two images on one page, there are multiple pages
to make up the book-->
<div class="back">
<a href="sketchbook3.html"><img src="../images/sketchbook4.jpg" alt="sketchbook page with click to next page"></a>
</div>
</main>发布于 2021-07-28 23:41:42
在href URL中使用哈希:
<a href="sketchbook3.html#imgid">其中,imgid是要在sketchbook3.html页面上滚动到的元素的ID。
https://stackoverflow.com/questions/68563354
复制相似问题