Maison  >  Questions et réponses  >  le corps du texte

css - angular前端如何让ng-repeat的内容并排一行,跑起来呢?

html代码:

<body ng-controller="mainCtrl">
        
        <table cellpadding="2" border="1" cellspacing="0">
            
            <thead>
                <th>Name</th>
                <th>Age</th>
                <th>node show</th>
            </thead>
            
            <tbody>
                <tr ng-repeat="d in datas">
                    
                    <td>{{d.name}}</td>
                    <td>{{d.age}}</td>
                    <td style="width: 500px;"><node-marquee></node-marquee></td>
                </tr>
            </tbody>
            
        </table>
    </body>

js:

app.controller("mainCtrl",['$scope',function($scope){
    
    $scope.datas=[{"name":"tom","age":22},{"name":"mary","age":36},{"name":"john","age":63}];
    
    
    
}]);

js指令:

app.directive('nodeMarquee', function($interval) {
    return {
        restrict : 'E',
        scope:{
            
        },    
        replace:true,
        templateUrl: 'marquee.html',
        link : function(scope, element, attrs){    
            
            
    };
});

marquee.html

<marquee bgcolor="azure" behavior="scroll" onmouseover="this.stop()" onmouseout="this.start()"  style="font-size:30px;font-weight: bolder;" >

<p ng-repeat="i in [4,5,6]">
    
    {{i}}
    
</p>


</marquee>

现在的效果是这样的:不是一行的。如何让其变成一行,这样显示:4<5<6,并且当鼠标移动到4上,停止滚动,并且弹出一个提示框显示4,当 鼠标离开,就继续跑马灯显示。5和6也一样

不是很懂前端啊,求帮忙!!

给我你的怀抱给我你的怀抱2713 Il y a quelques jours595

répondre à tous(4)je répondrai

  • PHPz

    PHPz2017-05-15 17:06:09

    Utiliser l'étendue

    répondre
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 17:06:09

    Le front-end ne comprend même pas ce que vous voulez demander

    répondre
    0
  • PHP中文网

    PHP中文网2017-05-15 17:06:09

    <p ng-repeat="i in [4,5,6]">{{i}}</p> Dans ce paragraphe, ng-repeat répète l'élément actuel après l'exécution, c'est <p>4</p><p>5</p><p>6</p>, donc ils ne sont pas sur la même ligne. Essayez de le changer en span, <span ng-repeat="i in [4,5,6]">{{i}}</span>.

    répondre
    0
  • PHP中文网

    PHP中文网2017-05-15 17:06:09

    Trouver un artiste pour ajuster le style

    répondre
    0
  • Annulerrépondre