AngularJS Mobile查看问题

时间:2015-08-02 09:34:20

标签: css angularjs twitter-bootstrap-3

我正在使用AngularJS构建一个SPA,一切都按照我希望的方式工作,除了我遇到有关它在移动设备上出现的问题(我正在使用twitter bootstrap 3)。这两个问题特别是:

  • 移动设备上的垂直滚动非常不稳定,有时会卡住
  • 在某些页面上,用户移动屏幕会自动放大输入字段,这很好。但是,我想在它们改变局部时撤消这个缩放;因为否则当用户到达下一个部分时,一切都变得过小。

我环顾四周,看不到这些问题的答案。我没有把代码放在这里,因为它几乎影响整个网站:)但是,为了演示这个问题你可以在网站上看到:www.objectivemoney.co.za。

非常感谢任何帮助!

更新包含代码

的index.html



<!DOCTYPE html>
<html lang="en-us" ng-app="omApp">
    <head>
        <title>OM</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Find your perfect planner | Quickly search for and compare verified, customer reviewed planners in your area with OM">
        <meta name="keywords" content="search,financial,planner,compare,verified,planners">

        <!-- load bootstrap and fontawesome via CDN -->
        <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
        <link rel="stylesheet" href="Font-Awesome-master/css/font-awesome.min.css" />
        <link href='//fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
        <link href='//fonts.googleapis.com/css?family=Merriweather:700' rel='stylesheet' type='text/css'>
        <link href='toaster/toaster.css' rel='stylesheet' type='text/css'>
        
        <!-- load CSS files locally -->
        <link rel="stylesheet" href="style-min.css" />
        <link rel="stylesheet" href="angular-slider-master/slider.css" />
        <link rel="stylesheet" href="animate.min.css" />
        
        <!-- sharethis -->
        <script type="text/javascript">var switchTo5x=true;</script>
        <script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>
        <script type="text/javascript">stLight.options({publisher: "XXXXXXXXXXXXX", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
        
	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  	ga('create', 'UA-XXXXXXX-X', { 'cookieDomain': 'none' });
	</script>
    
    </head>
        <body>
            <!-- create a navbar that is collapsable in a mobile view -->
            <nav id="navbar-example" class="navbar navbar-inverse navbar-static" role="navigation" ng-controller="searchController">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <button class="navbar-toggle" type="button" ng-click="isCollapsed = !isCollapsed">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="#/">       <img id="navbarlogo" src="./img/logo/logo-white.png"></a>
                    </div>
                    <div collapse="isCollapsed" class="navbar-collapse bs-js-navbar-collapse">
                        <ul class="nav navbar-nav">
                            <ul class="nav navbar-nav navbar-right">
                                <li><a href="#/">Home</a></li>
                                <li><a href="#/search">Search</a></li>
                                <li><a href="#/resources">Resources</a></li>
                                <li><a href="#/login">Planner Registration</a></li>
                            </ul>
                        </ul>
                        <!-- create a logout sign that shows when a user is logged in, position this on the right of the navbar -->
                        <ul ng-show="authenticated === true" class="nav navbar-nav pull-right logoutlink ng-cloak">
                            <ul class="nav navbar-nav navbar-right">
                                <li><a ng-controller="searchController" ng-click="logout(); changeAuth()">Logout</a></li>
                            </ul>
                        </ul>
                    </div><!-- /.nav-collapse -->
                </div><!-- /.container-fluid -->
            </nav>      
        
        <!-- Create container for app views -->
        <div class="wrapper">
            <!-- set empty div for views, autoscroll means that page scrolls to top when user clicks through -->
            <div ng-view autoscroll="true"></div>
        <div class="push"></div>
		</div>
        <div class="footer">
            <footer>
                <div>
                        <div id="footershare" class="col-sm-6">
                                <span class='st_twitter_large' displayText='Tweet'></span>
                                <span class='st_facebook_large' displayText='Facebook'></span>
                                <span class='st_linkedin_large' displayText='LinkedIn'></span>
                                <span class='st_googleplus_large' displayText='Google +'></span>
                                <span class='st_email_large' displayText='Email'></span>
                        </div>
                        <div id="footercontact" class="col-sm-6">
                            <p>Contact: xxx@xxx.co.za | Copyright &copy;</p>
                        </div>
                </div>
            </footer>
        </div>
        <div class="ng-cloak" ng-controller="searchController">
            <div ng-show="showBar" class="signupBox">
                <p id ="signupBox-text"><span ng-click="setCloseBar();setShowBar()" class="signupBox-close pull-right"><b>&times;</b></span><a id ="signupBox-text" href="#/mailinglist" ng-click="setCloseBar();setShowBar()">Join Our Mailing List To Stay Up To Date With The Latest Planning Advise And News.</a></p>
            </div>
        </div>            

        <!-- load angular and additional precompiled services -->
        <script src="//code.angularjs.org/1.4.0-rc.2/angular.min.js"></script>
        <script src="//code.angularjs.org/1.4.0-rc.2/angular-route.min.js"></script>
        <script src="//code.angularjs.org/1.4.1/angular-animate.min.js"></script>
        <script src="//code.angularjs.org/1.4.0-rc.2/angular-messages.min.js"></script>
        <script src="//code.angularjs.org/1.4.0/angular-resource.min.js"></script>
        <script src="//maps.googleapis.com/maps/api/js?libraries=places"></script>
        <script src="vs-google-autocomplete.min.js"></script>
        <script src="angulartics.min.js"></script>
        <script src="angulartics-ga.min.js"></script>
        <script src="toaster/toaster.js"></script>
        <script src="ui-bootstrap-0.13.0.min.js"></script>
        <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.0.js"></script>
        <script src="angular-slider-master/slider.js"></script>
        <script src="bower_components/ng-optimizely/ng-optimizely.js"></script>
            
        <!-- load angular app -->
        <script src="modules/omApp.js"></script>
        
        <!-- load custom services -->
        <script src="services/services.min.js"></script>
        <script src="services/data.min.js"></script>
        
        <!-- load angular controllers -->
        <script src="controllers/minified/searchController.js"></script>
        <script src="controllers/minified/resourcesController.js"></script>
        <script src="controllers/minified/plannerRegController.js"></script>
        
        <!-- directives -->
        <script src="directives/directive.min.js"></script>            
            
    </body>
    <!-- toaster-container that shows when a user log ins and log out [CURRENTLY THE TOASTER SHOWS FOR TOO LONG AND TIME OUT FUNCTION DOES NOT CHANGE TOASTER DISPLAY TIME] -->
    <toaster-container toaster-options="{'time-out': 2000}"></toaster-container>
</html>
&#13;
&#13;
&#13;

首页部分

&#13;
&#13;
<div class="jumbotron">
    <div class="container">
        <div class="homepage-jumbo-info col-sm-offset-7 col-sm-5">
            <div class="homepage-jumbo-info-header">
                <h1>We'll help you find a <br><b> planner</b>, hassle-free</h1>
            </div>
            <div class="homepage-jumbo-info-box">
                <h2 class="homepage-jumbo-info-boxheader"><b>Compare verified planners</b> in your area</h2>
                <input vs-google-autocomplete="options"         
                ng-model="searchquery.address.name" 
                vs-street-number="searchquery.address.streetNumber" 
                vs-street="searchquery.address.street"
                vs-city="searchquery.address.city"
                vs-state="searchquery.address.state"
                vs-country-short="searchquery.address.countryCode"
                vs-country="searchquery.address.country"
                vs-latitude="searchquery.lat"
                vs-longitude="searchquery.long" 
                type="text" 
                name="address"
                id="address"
                class="form-control homepage-jumbo-info-boxinput"
                placeholder="In which city / suburb do you live?">
            </div>
            <div class="form-group homepage-searchbutton homepage-jumbo-info-boxbutton">
                <p id="homepage-searchbutton-text"><a href="#/search" class="searchprofilefooter-link">SEARCH NOW&nbsp;&nbsp;&nbsp;<i class="fa fa-search"></i></a></p>
            </div>
        </div>
    </div>
</div>

<div class="container-fluid homepage-body-steps">
    <div class="col-sm-12 homepage-body-header">
        <h2><b>Find The Right Planner With 3 Simple Steps</b></h2>
    </div>

    <div class="col-sm-4 homepage-body-steps-info">
            <h4 class="homepage-body-icons"><img id="homepage-body-icons" src="img/icons/search.png"></img></h4>
            <h3 class="homepage-body-icons-title"><b>SEARCH</b></h3>
            <p class="homepage-body-icons-text">Search for independently verified planners in your local area that can meet your requirements.</p>
    </div>

    <div class="col-sm-4 homepage-body-steps-info">
            <h4 class="homepage-body-icons"><img id="homepage-body-icons" src="img/icons/compare.png"></img></h4>
            <h3 class="homepage-body-icons-title"><b>COMPARE</b></h3>
            <p class="homepage-body-icons-text">Compare planners based on their offerings, qualifications and actual customer reviews.</p>
    </div>

    <div class="col-sm-4 homepage-body-steps-info">
        <h4 class="homepage-body-icons"><img id="homepage-body-icons" src="img/icons/schedule.png"></img></h4>
        <h3 class="homepage-body-icons-title"><b>SCHEDULE</b></h3>
        <p class="homepage-body-icons-text">Click to automatically schedule a meeting with your chosen planner at a time that suits you.</p>
    </div>
</div>
    <div class="row homepage-body-carousel-header">
        <div class="col-sm-12 homepage-body-header">
        <h2><b>Our Planners Partner With The Biggest Companies In South Africa</b></h2>
        </div>
    </div>
    <div class="row homepage-body-carousel">
        <carousel interval="myInterval" disable-animation="true">
            <slide ng-repeat="slide in slides" active="slide.active">
              <img ng-src="img/sitephotos/{{slide.image}}.png" alt="{{slide.image}}" style="margin:auto;">
            </slide>
        </carousel>
    </div>

    <div class="container-fluid homepage-body-video">
            <p class="homepage-body-video-text">Watch our short video to see how it works in more detail</p>
                <div class="videoWrapper">
                    <!-- Copy & Pasted from YouTube -->
                    <iframe width="560" height="315" src="https://www.youtube.com/embed/-rsr45s2mws" frameborder="0" allowfullscreen></iframe>
                </div>
    </div>

<div class="container-fluid homepage-body-steps">
    <div class="col-sm-12 homepage-body-header">
        <h2><b>How OM Helps You</b></h2>
    </div>
    <div class="row">
    <div class="col-sm-4 homepage-body-steps-info">
        <h4 class="homepage-body-icons"><img id="homepage-body-icons-how" src="img/icons/independent.png"></img></h4>
        <h3 class="homepage-body-icons-title"><b>INDEPENDENT</b></h3>
        <p class="homepage-body-icons-text">All of our advisers have been independently verified, helping you to avoid any sharks.</p>
    </div>

    <div class="col-sm-4 homepage-body-steps-info">
            <h4 class="homepage-body-icons"><img id="homepage-body-icons-how" src="img/icons/user-review.png"></img></h4>
            <h3 class="homepage-body-icons-title"><b>USER REVIEWED</b></h3>
            <p class="homepage-body-icons-text">All of our advisers are reviewed by genuine users, helping you make sure that the adviser is the right match for you.</p>
    </div>

    <div class="col-sm-4 homepage-body-steps-info">
            <h4 class="homepage-body-icons"><img id="homepage-body-icons-how" src="img/icons/tailored.png"></img></h4>
            <h3 class="homepage-body-icons-title"><b>TAILORED</b></h3>
            <p class="homepage-body-icons-text">Search functionality lets you specify your ideal adviser.</p>
    </div>
    </div>    

    <div class="row">
    <div class="col-sm-offset-2 col-sm-4 homepage-body-steps-info">
        <h4 class="homepage-body-icons"><img id="homepage-body-icons-how" src="img/icons/quick.png"></img></h4>
        <h3 class="homepage-body-icons-title"><b>QUICK</b></h3>
        <p class="homepage-body-icons-text">No need for lengthy internet research, enquiry calls or getting hold of friends and family to help you.</p>
    </div>
    
    <div class="col-sm-offset-right-2 col-sm-4 homepage-body-steps-info">
        <h4 class="homepage-body-icons"><img id="homepage-body-icons-how" src="img/icons/free-2.png"></img></h4>
        <h3 class="homepage-body-icons-title"><b>FREE</b></h3>
        <p class="homepage-body-icons-text">Our service is entirely free of charge.</p>
    </div>
    </div>

</div>
&#13;
&#13;
&#13;

杰克

0 个答案:

没有答案