Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
锚定标签不';I don’我不能翻阅另一页 我用基金会和PHP建立了一个网站。在我的索引文件.html中,我使用基础滚动特性滚动到我的页面的不同部分。_Php_Html_Anchor - Fatal编程技术网

锚定标签不';I don’我不能翻阅另一页 我用基金会和PHP建立了一个网站。在我的索引文件.html中,我使用基础滚动特性滚动到我的页面的不同部分。

锚定标签不';I don’我不能翻阅另一页 我用基金会和PHP建立了一个网站。在我的索引文件.html中,我使用基础滚动特性滚动到我的页面的不同部分。,php,html,anchor,Php,Html,Anchor,在我的php页面上,我想设置我的导航链接,以便它们链接到index.html上各自的部分,我认为使用锚定标记会很容易。然而,我的链接只有第一个(第二个)链接正确,其余的直接进入index.html页面的底部 我一直在寻找,我找不到为什么只有一个可以工作,而其他的不行,有什么我遗漏的吗?这是我的密码 //代码 //Target Section in index.html <div class="row"> <div class="large-8 colu

在我的php页面上,我想设置我的导航链接,以便它们链接到index.html上各自的部分,我认为使用锚定标记会很容易。然而,我的链接只有第一个(第二个)链接正确,其余的直接进入index.html页面的底部

我一直在寻找,我找不到为什么只有一个可以工作,而其他的不行,有什么我遗漏的吗?这是我的密码

//代码

//Target Section in index.html

    <div class="row">
        <div class="large-8 column large-centered" id="third" data-magellan-target="third">
            <h2 class="heading">Location</h2>
            <div class="border">
                <div id="map">
                    <!--Map Location-->
                </div>
            </div>

        </div>
    </div> 

//navigation on php page

                <div class="top-bar-right">
                    <ul class="menu vertical medium-horizontal nav" data-responsive-menu="drilldown medium-dropdown" data-magellan>
                        <li><a href="index.html">Home</a></li>
                        <li><a href="#">Sales</a></li>
                        <li><a href="#">Lettings</a></li>
                        <li><a href="index.html#second">Gallery</a></li>
                        <li><a href="index.html#third">Location</a></li>
                        <li><a href="index.html#fourth">Contact Us</a></li>
                    </ul>
                </div>
//index.html中的目标节
位置
//php页面上的导航
cory这是滚动警告的代码

/**
 * Magellan module.
 * @module foundation.magellan
 */
!function(Foundation, $) {
  'use strict';

  /**
   * Creates a new instance of Magellan.
   * @class
   * @fires Magellan#init
   * @param {Object} element - jQuery object to add the trigger to.
   * @param {Object} options - Overrides to the default plugin settings.
   */
  function Magellan(element, options) {
    this.$element = element;
    this.options  = $.extend({}, Magellan.defaults, this.$element.data(), options);

    this._init();

    Foundation.registerPlugin(this);
  }

  /**
   * Default settings for plugin
   */
  Magellan.defaults = {
    /**
     * Amount of time, in ms, the animated scrolling should take between locations.
     * @option
     * @example 500
     */
    animationDuration: 500,
    /**
     * Animation style to use when scrolling between locations.
     * @option
     * @example 'ease-in-out'
     */
    animationEasing: 'linear',
    /**
     * Number of pixels to use as a marker for location changes.
     * @option
     * @example 50
     */
    threshold: 50,
    /**
     * Class applied to the active locations link on the magellan container.
     * @option
     * @example 'active'
     */
    activeClass: 'active',
    /**
     * Allows the script to manipulate the url of the current page, and if supported, alter the history.
     * @option
     * @example true
     */
    deepLinking: false,
    /**
     * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
     * @option
     * @example 25
     */
    barOffset: 0
  };

  /**
   * Initializes the Magellan plugin and calls functions to get equalizer functioning on load.
   * @private
   */
  Magellan.prototype._init = function() {
    var id = this.$element[0].id || Foundation.GetYoDigits(6, 'magellan'),
        _this = this;
    this.$targets = $('[data-magellan-target]');
    this.$links = this.$element.find('a');
    this.$element.attr({
      'data-resize': id,
      'data-scroll': id,
      'id': id
    });
    this.$active = $();
    this.scrollPos = parseInt(window.pageYOffset, 10);

    this._events();
  };
  /**
   * Calculates an array of pixel values that are the demarcation lines between locations on the page.
   * Can be invoked if new elements are added or the size of a location changes.
   * @function
   */
  Magellan.prototype.calcPoints = function(){
    var _this = this,
        body = document.body,
        html = document.documentElement;

    this.points = [];
    this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));
    this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));

    this.$targets.each(function(){
      var $tar = $(this),
          pt = Math.round($tar.offset().top - _this.options.threshold);
      $tar.targetPoint = pt;
      _this.points.push(pt);
    });
  };
  /**
   * Initializes events for Magellan.
   * @private
   */
  Magellan.prototype._events = function() {
    var _this = this,
        $body = $('html, body'),
        opts = {
          duration: _this.options.animationDuration,
          easing:   _this.options.animationEasing
        };

    $(window).one('load', function(){
      _this.calcPoints();
      _this._updateActive();
    });

    this.$element.on({
      'resizeme.zf.trigger': this.reflow.bind(this),
      'scrollme.zf.trigger': this._updateActive.bind(this)
    }).on('click.zf.magellan', 'a[href^="#"]', function(e) {
        e.preventDefault();
        var arrival   = this.getAttribute('href'),
            scrollPos = $(arrival).offset().top - _this.options.threshold / 2 - _this.options.barOffset;

        // requestAnimationFrame is disabled for this plugin currently
        // Foundation.Move(_this.options.animationDuration, $body, function(){
          $body.stop(true).animate({
            scrollTop: scrollPos
          }, opts);
        });
      // });
  };
  /**
   * Calls necessary functions to update Magellan upon DOM change
   * @function
   */
  Magellan.prototype.reflow = function(){
    this.calcPoints();
    this._updateActive();
  };
  /**
   * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.
   * @private
   * @function
   * @fires Magellan#update
   */
  Magellan.prototype._updateActive = function(/*evt, elem, scrollPos*/){
    var winPos = /*scrollPos ||*/ parseInt(window.pageYOffset, 10),
        curIdx;

    if(winPos + this.winHeight === this.docHeight){ curIdx = this.points.length - 1; }
    else if(winPos < this.points[0]){ curIdx = 0; }
    else{
      var isDown = this.scrollPos < winPos,
          _this = this,
          curVisible = this.points.filter(function(p, i){
            return isDown ? p <= winPos : p - _this.options.threshold <= winPos;//&& winPos >= _this.points[i -1] - _this.options.threshold;
          });
      curIdx = curVisible.length ? curVisible.length - 1 : 0;
    }

    this.$active.removeClass(this.options.activeClass);
    this.$active = this.$links.eq(curIdx).addClass(this.options.activeClass);

    if(this.options.deepLinking){
      var hash = this.$active[0].getAttribute('href');
      if(window.history.pushState){
        window.history.pushState(null, null, hash);
      }else{
        window.location.hash = hash;
      }
    }

    this.scrollPos = winPos;
    /**
     * Fires when magellan is finished updating to the new active element.
     * @event Magellan#update
     */
    this.$element.trigger('update.zf.magellan', [this.$active]);
  };
  /**
   * Destroys an instance of Magellan and resets the url of the window.
   * @function
   */
  Magellan.prototype.destroy = function(){
    this.$element.off('.zf.trigger .zf.magellan')
        .find('.' + this.options.activeClass).removeClass(this.options.activeClass);

    if(this.options.deepLinking){
      var hash = this.$active[0].getAttribute('href');
      window.location.hash.replace(hash, '');
    }

    Foundation.unregisterPlugin(this);
  };
  Foundation.plugin(Magellan, 'Magellan');

  // Exports for AMD/Browserify
  if (typeof module !== 'undefined' && typeof module.exports !== 'undefined')
    module.exports = Magellan;
  if (typeof define === 'function')
    define(['foundation'], function() {
      return Magellan;
    });

}(Foundation, jQuery);
/**
*麦哲伦舱。
*@模块基础
*/
!功能(基础,$){
"严格使用",;
/**
*创建麦哲伦的新实例。
*@级
*@fires麦哲伦#init
*@param{Object}element-要将触发器添加到的jQuery对象。
*@param{Object}options-覆盖默认插件设置。
*/
功能麦哲伦(元素,选项){
此.$element=元素;
this.options=$.extend({},Magellan.defaults,this.$element.data(),options);
这个;
RealStPuthin(此);
}
/**
*插件的默认设置
*/
麦哲伦默认值={
/**
*动画滚动在两个位置之间应花费的时间量(毫秒)。
*@选项
*@example 500
*/
动画持续时间:500,
/**
*在位置之间滚动时要使用的动画样式。
*@选项
*@example“ease in out”
*/
动画设置:“线性”,
/**
*用作位置更改标记的像素数。
*@选项
*@example 50
*/
阈值:50,
/**
*类应用于麦哲伦容器上的活动位置链接。
*@选项
*@example“active”
*/
activeClass:'活动',
/**
*允许脚本操作当前页面的url,如果支持,还可以更改历史记录。
*@选项
*@example-true
*/
深度链接:错,
/**
*如果使用粘性导航条,则在单击项目时偏移页面滚动的像素数。
*@选项
*@example 25
*/
气压偏移:0
};
/**
*初始化Magellan插件并调用函数以使均衡器在负载时正常工作。
*@私人
*/
prototype.\u init=function(){
var id=.$元素(0).ID.*基础。GETYODIGITS(6,‘麦哲伦’),
_这个=这个;
这个.$targets=$(“[data magellan target]”);
this.$links=this.$element.find('a');
这是$element.attr({
“数据大小”:id,
“数据滚动”:id,
“id”:id
});
这个。$active=$();
this.scrollPos=parseInt(window.pageYOffset,10);
这个;
};
/**
*计算像素值数组,这些像素值是页面上位置之间的分界线。
*可以在添加新元素或位置大小更改时调用。
*@函数
*/
Magellan.prototype.calcPoints=函数(){
var_this=这个,
body=document.body,
html=document.documentElement;
此参数为.points=[];
this.winHeight=Math.round(Math.max(window.innerHeight,html.clientHeight));
this.docHeight=Math.round(Math.max(body.scrollHeight,body.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight));
此.$targets.each(函数(){
var$tar=$(此),
pt=Math.round($tar.offset().top-_this.options.threshold);
$tar.targetPoint=pt;
_这个.点.推(pt);
});
};
/**
*初始化麦哲伦的事件。
*@私人
*/
prototype.\u events=function(){
var_this=这个,
$body=$('html,body'),
选项={
持续时间:_this.options.animationDuration,
放松:_this.options.animationEasing
};
$(窗口).one('load',function(){
_这个.calcPoints();
_这是。_updateActive();
});
这是$element.on({
'resizeme.zf.trigger':this.reflow.bind(this),
'scrollme.zf.trigger':this.\u updateActive.bind(this)
}).on('click.zf.magellan','a[href^=“#”]”,函数(e){
e、 预防默认值();
var arrival=this.getAttribute('href'),
scrollPos=$(arrival.offset().top-_this.options.threshold/2-_this.options.barOffset;
//此插件当前已禁用requestAnimationFrame
//Fask.Meod(Apth.Opth.SimultSimultSimult$$体,函数)({)
$body.stop(true)。设置动画({
scrollTop:scrollPos
},opts);
});
// });
};
/**
*调用必要的函数在DOM更改时更新Magellan
*@函数
*/
Magellan.prototype.reflow=函数(){
这个.calcPoints();
这是。_updateActive();
};
/**
*更新活动位置链接的可见性,并更新页面的url哈希(如果启用了深度链接)。
*@私人
*@函数
*@fires Magellan#更新
*/
prototype.\u updateActive=函数(/*evt、elem、scrollPos*/){
var winPos=/*scrollPos | |*/parseInt(window.pageYOffset,10),
库里克斯;
如果(winPos+this.winHeight==this.docHeight){curIdx=this.points.length-1;}
else if(winPos<p></p>