追加div至身体的时候,URL散列#变化 [英] Append div to body when URL hash # changes

查看:114
本文介绍了追加div至身体的时候,URL散列#变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 curtain.js 并想保持一个DIV(持有导航)时刻除了当用户正在看的第一面板,即在页面的顶部可见。

目前的DIV位于面板二十年内

我想用,你通过页面滚动哈希变化触发追加对身体可能。 Curtain.js每个小组创建一个单独的URL和URL每个小组被带入看法就会改变。

我可以追加div来身体(如下图),但我需要解决时,要做到这一点,但我不知道该如何?谁能帮助我?

  $(机构)追加($()'的资产净值,包装。');


解决方案

确定的好,而使用一些哈克解决方案,经过多次的插件的文件周围挖,我只是说:

  $(机构)追加($()'的资产净值,包装。');

就行491. setHash 函数的工作一种享受。

I'm using curtain.js and would like to keep a DIV (which holds navigation) visible at all times except for when the user is looking at the very first panel, i.e. at the top of the page.

Currently the DIV resides within panel two

I'm thinking perhaps of using the hash change as you scroll through the page to trigger an append to the body. Curtain.js creates an individual URL for each panel and the URL changes each time a panel is brought into view.

I can append the div to the body (below) but I need to work out when to do this but I am unsure how? Could anyone help me out?

$("body").append($('.nav-wrap'));

解决方案

Ok well instead of using some hacky solution, after much digging around in the plugin's file, I just added:

$("body").append($('.nav-wrap'));

to the setHash function on line 491. Works a treat.

这篇关于追加div至身体的时候,URL散列#变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆