首页 \ 问答 \ 当经过另一个时隐藏固定元素(Hide fixed element when past another)

当经过另一个时隐藏固定元素(Hide fixed element when past another)

这是一个小演示:

HTML

<body>
    <div class="container-empty"></div>
    <ul>
        <div id="divfix"><li id="lifix">Text 1 FIXED</li></div>
        <div id="divfix2"><li id="lifix2">Text 2 FIXED</li></div>
        <div id="divfix3"><li id="lifix3">Text 3 FIXED</li></div>
    </ul>
    <div class="container-footer"></div>
</body>

JSCRIPT

var toppag=$("#lifix,#lifix2,#lifix3");
var pag=$("#divfix,#divfix2,#divfix3");

toppag.css({position:"relative"});


$(window).scroll(function () {
    var scroll=$(this).scrollTop();
    pag.each(function(i,n){
        if(scroll < $(this).offset().top) {
            toppag.eq(i).css({'position':'relative'});
        }
        if(scroll > ($(this).offset().top + toppag.eq(i).height()))  {
            toppag.eq(i).css({'position':'fixed',"top":"0"});
        }
    }); 
});

在这里演示: https//jsfiddle.net/Kigris/4cb0ygun/2/

当达到“Text 2 FIXED”时,我想隐藏“Text 1 FIXED”等。 此外,当所有到达页脚都隐藏它们。


Here is a small demo:

HTML

<body>
    <div class="container-empty"></div>
    <ul>
        <div id="divfix"><li id="lifix">Text 1 FIXED</li></div>
        <div id="divfix2"><li id="lifix2">Text 2 FIXED</li></div>
        <div id="divfix3"><li id="lifix3">Text 3 FIXED</li></div>
    </ul>
    <div class="container-footer"></div>
</body>

JSCRIPT

var toppag=$("#lifix,#lifix2,#lifix3");
var pag=$("#divfix,#divfix2,#divfix3");

toppag.css({position:"relative"});


$(window).scroll(function () {
    var scroll=$(this).scrollTop();
    pag.each(function(i,n){
        if(scroll < $(this).offset().top) {
            toppag.eq(i).css({'position':'relative'});
        }
        if(scroll > ($(this).offset().top + toppag.eq(i).height()))  {
            toppag.eq(i).css({'position':'fixed',"top":"0"});
        }
    }); 
});

DEMO HERE: https://jsfiddle.net/Kigris/4cb0ygun/2/

I want to hide "Text 1 FIXED" when reaches "Text 2 FIXED" and so on. Also, when all reach the footer hide them all.


原文:https://stackoverflow.com/questions/42862984
更新时间:2022-12-05 17:12

最满意答案

我从来没有使用它,但skip选项应该做你需要的。

您可以在control文件中定义要跳过的行数,如下所示:

OPTIONS (SKIP=1)
LOAD DATA INFILE ...

或者您可以在命令中执行此操作,如下所示:

sqlldr userid=xxxx/yyyy control=mycontrolfile.ctl skip=1

I've never used it, but the skip option should do what you need.

You can define the number of rows to skip in your control file like this:

OPTIONS (SKIP=1)
LOAD DATA INFILE ...

Or you can do it at the command like like this:

sqlldr userid=xxxx/yyyy control=mycontrolfile.ctl skip=1

相关问答

更多
  • 您可以使用Sql Server Management Studioo中的导入向导执行此操作。 右键单击数据库,然后转到“任务”>“导入数据”。 在“选择数据源”对话框中,从下拉列表中选择“Excel选项”。 按照这里的步骤 You can do this using Import Wizard in Sql Server Management Studioo. Right click on the database and go to Tasks > Import Data . In Choose Data ...
  • 你有两个解决方案: 您可以不使用.dat文件的第一行 我想你是在逐行阅读它... 我是这样,只是不要使用第一行(您可以使用变量作为计数器来知道您是否在第一行) 或者,您可以在将数据插入数据库之前测试当前行是否仅包含整数/数字。 如果您选择第二个解决方案,以下是可以作为起点的一部分代码: if (in_numeric($data[0]) && is_numeric($data[1]) && is_numeric($data[2])) { $sql_qry = "INSERT INTO DatTable ...
  • 因为您使用的是10g,所以可以使用外部表而不是SQL Loader。 设置外部表很容易。 了解更多 。 要使外部表获取新文件(您可能需要执行此操作,因为您有重复过程),请执行以下操作: alter table your_ext_table_name location ('') / 然后你可以这样做: insert into whatever_table@remote_db select * from your_ext_table_name / 这避免了两批DML。 ...
  • 关于如何从中删除行,Excel非常挑剔。 您最好的选择是选择列标题下方的所有行,然后右键单击并删除。 如果您只是清除内容然后不粘贴任意数量的行,它会向SSIS看起来就像您的行中包含空值,这有时会导致您看到的错误类型。 Excel is very finicky about how you remove rows from it. Your best bet is to select all rows below the column headers and right click and delete. I ...
  • SQL * Loader是一种用于将各种格式的数据加载到Oracle数据库的工具。 我希望使用数据库的SQL接口来提取数据,除了SQL * Loader之外的其他东西,如果它只是一行或两行,则读取csv文件 - 您可以使用SQL将该数据加载到数据库。 SQL*Loader is a tool for loading data in a variety of formats to an Oracle database. I would be looking to use a SQL interface to ...
  • 我想我有一个解决方案。 我保持SSIS解决方案不变,而是使用SQL Server中的触发器在有问题的表更改时插入当前日期。 I think I have a solution. I left the SSIS solution unchanged and instead used a trigger in the SQL Server to insert the current date when the table in question is changed.
  • 我从来没有使用它,但skip选项应该做你需要的。 您可以在control文件中定义要跳过的行数,如下所示: OPTIONS (SKIP=1) LOAD DATA INFILE ... 或者您可以在命令中执行此操作,如下所示: sqlldr userid=xxxx/yyyy control=mycontrolfile.ctl skip=1 I've never used it, but the skip option should do what you need. You can define the ...
  • 本指南可帮助http://www.ashishblog.com/importexport-excel-xlsx-or-xls-file-into-sql-server/ 您需要适用于您的办公室版本的xlsx文件下载驱动程序的数据连接组件 This guide help http://www.ashishblog.com/importexport-excel-xlsx-or-xls-file-into-sql-server/ you need Data Connectivity Components for ...
  • 在你的sp_Reconfigure下,看到你在这里引用了一篇文章..但是,我想你可能需要去微软而不是.. http://technet.microsoft.com/en-us/library/ms187569%28v=sql.90%29.aspx 这里有很多关于如何使用OPENROWSET的例子 - http://technet.microsoft.com/en-us/library/ms190312%28v=sql.90%29.aspx Under your sp_Reconfigure, see tha ...
  • 从Excel导入一次性导入数据的最简单方法是使用SQL Server导入和导出向导,如问题中的图片所示。 您应选择Microsoft Excel作为数据源,指定电子表格的文件路径,并指定第一行是否包含列标题。 然后指定目标SQL服务器和数据库。 从图表中选择的选项中选择另一个选项 - “从一个或多个表或视图复制数据”。 然后,您可以在电子表格中选择要导入的工作表,并指定要将数据放入的目标表。 重要的是,您可以编辑映射,以便电子表格中的数据进入表中的正确列 - 现有表或新表。 在幕后,向导会生成与您问题中的脚 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)