如何激活onclick上的视频说明?(How do I make video description active onclick?)
我有一堆视频,想知道在播放视频时如何激活描述?
我已经能够添加悬停状态,但在播放该视频时它不会保留金色。
<iframe id="vid_frame4" class="active" src="https://www.youtube.com/embed/cEQeHCG70Bw?enablejsapi=1&version=3&playerapiid=ytplayer&rel=0" frameborder="0" width="454" height="255" allowscriptaccess="always" allowfullscreen></iframe> <div class="vid-item" onClick="document.getElementById('vid_frame4').src='http://youtube.com/embed/cEQeHCG70Bw?enablejsapi=1&version=3&playerapiid=ytplayer&autoplay=1&rel=0&autohide=1'" allowscriptaccess="always"> <div class="thumb"><img src="http://img.youtube.com/vi/cEQeHCG70Bw/2.jpg"></div> <div class="desc active" onClick=".addClass(active)">Directions for Use</div> </div> <div class="vid-item" onClick="document.getElementById('vid_frame4').src='http://youtube.com/embed/dPxKQ7uh6xg?enablejsapi=1&version=3&playerapiid=ytplayer&autoplay=1&rel=0&autohide=1'" allowscriptaccess="always"> <div class="thumb"><img src="http://img.youtube.com/vi/dPxKQ7uh6xg/2.jpg"></div> <div class="desc">Cup Size Programming</div> </div> .vid-item { width: 212px; height: 119px; float: left; margin: 15px 30px 0px 0; padding: 0px; } .thumb { /*position: relative;*/ overflow:hidden; height: 100px; } .thumb img { width: 100%; position: relative; top: -20px; } .vid-item .desc { color: #000000; margin-top:5px; height:30px; float:left; text-align:left; } .vid-item .desc:hover, .vid-item .desc:active { color: #c79b4c; margin-top:5px; height:30px; float:left; text-align:left; } .vid-item:hover { cursor: pointer; }
这是js小提琴: https : //jsfiddle.net/designstreet1/awbyf1h5/
任何帮助将非常感谢
I have a bunch of videos and wanted to know how to make the description active when that video is playing?
I have been able to add a hover state but it doesn't stay gold when that video is playing.
<iframe id="vid_frame4" class="active" src="https://www.youtube.com/embed/cEQeHCG70Bw?enablejsapi=1&version=3&playerapiid=ytplayer&rel=0" frameborder="0" width="454" height="255" allowscriptaccess="always" allowfullscreen></iframe> <div class="vid-item" onClick="document.getElementById('vid_frame4').src='http://youtube.com/embed/cEQeHCG70Bw?enablejsapi=1&version=3&playerapiid=ytplayer&autoplay=1&rel=0&autohide=1'" allowscriptaccess="always"> <div class="thumb"><img src="http://img.youtube.com/vi/cEQeHCG70Bw/2.jpg"></div> <div class="desc active" onClick=".addClass(active)">Directions for Use</div> </div> <div class="vid-item" onClick="document.getElementById('vid_frame4').src='http://youtube.com/embed/dPxKQ7uh6xg?enablejsapi=1&version=3&playerapiid=ytplayer&autoplay=1&rel=0&autohide=1'" allowscriptaccess="always"> <div class="thumb"><img src="http://img.youtube.com/vi/dPxKQ7uh6xg/2.jpg"></div> <div class="desc">Cup Size Programming</div> </div> .vid-item { width: 212px; height: 119px; float: left; margin: 15px 30px 0px 0; padding: 0px; } .thumb { /*position: relative;*/ overflow:hidden; height: 100px; } .thumb img { width: 100%; position: relative; top: -20px; } .vid-item .desc { color: #000000; margin-top:5px; height:30px; float:left; text-align:left; } .vid-item .desc:hover, .vid-item .desc:active { color: #c79b4c; margin-top:5px; height:30px; float:left; text-align:left; } .vid-item:hover { cursor: pointer; }
Here's the js fiddle: https://jsfiddle.net/designstreet1/awbyf1h5/
Any help would be very much appreciated
原文:https://stackoverflow.com/questions/33112787
更新时间:2024-04-22 13:04
最满意答案
- 通过运行命令创建迁移 :
php artisan make:migration users_disabled_column
其中
disabled
是要添加到现有表的列的名称。
- 使用添加列编辑新迁移,以下是示例:
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class UsersDisabledColumn extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function($table) { $table->boolean('disabled')->default(false); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function($table) { $table->dropColumn('disabled'); }); } }
- 执行创建的迁移:
php artisan migrate
- 现在您可以使用新列:
$user = User::find($id); $user->disabled = false; $user->save();
- Create migration by running command:
php artisan make:migration users_disabled_column
where
disabled
is name of column you want to add to existed table.
- Edit new migration with adding column, here is example:
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class UsersDisabledColumn extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function($table) { $table->boolean('disabled')->default(false); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function($table) { $table->dropColumn('disabled'); }); } }
- Execute created migration:
php artisan migrate
- Now you can use new column:
$user = User::find($id); $user->disabled = false; $user->save();
相关问答
更多-
Laravel:使用Eloquent ORM的N到N(mysql)关系(Laravel: N to N (mysql) relation using Eloquent ORM)[2023-10-02]
我刚刚加入stackoverflow,所以我没有足够的信用评论所以我会在这里留下一个asnwer。 首先请更正您的关系定义。 在用户模型中:(你这里有错误) public function countries(){ return $this->belongsToMany(Country::class); } 在您的国家模型中: public function users(){ return $this->belongsToMany(User::class); } 第二,你需要使用以下方法 ... -
不。你的hasManyThrough通气很好,但是当你调用profile_images方法时它会返回QueryBuilder实例。 要获取相关模型的集合,请使用get方法 $images = $user->profile_images()->get(); 或者只是使用laravel的“魔法” $images = $user->profile_images; No. Your hasManyThrough ralation are fine, but when you call profile_image ...
-
将您的Eloquent模型添加到config/app.php的aliases列表中。 例如, 'User' => 'App\User'将使您的用户模型可用作\User到处。 Add your Eloquent models to the aliases list in config/app.php. For example, 'User' => 'App\User' will make your User model available as \User everywhere.
-
超薄框架和雄辩的ORM(Slim Framework and Eloquent ORM)[2022-09-05]
您可以使用Composer自动包含项目中的类。 假设您的composer.json文件存在于app 。 然后,您可以使用classmap中的classmap属性自动包含models所有类: ... "require": { "php" : ">=5.4.0", "slim/slim" : "2.*", "illuminate/database" : "5.0.33", ... }, "autoload": { "classmap" : [ "model ... -
Eloquent允许你轻松地做到这一点:) https://laravel.com/docs/5.2/eloquent-relationships#eager-loading 如果您还需要与每个日志相关的用户,您只需要像这样急切加载它 $sites = Site::with('log.user')->get(); Eloquent allows you to do that easily :) https://laravel.com/docs/5.2/eloquent-relationships#eager ...
-
雄辩的ORM和EAV(Eloquent ORM and EAV)[2022-05-10]
有一些方法可以解决这个问题(正如我通过其他论坛帖子发现的那样): 为每个EAV组件创建一个模型,例如伪代码: class Object extends Eloquent{ public function objects(){ return $this->hasMany('Attribute'); } } class Attribute extends Eloquent{ public function attributes(){ return $th ... -
如何使用Scope在Eloquent ORM中选择除(A和B)之外的所有行?(How to select all rows except (A and B) in Eloquent ORM using Scope?)[2022-04-30]
可以将范围与急切加载结合使用。 像那样: User::with(['notifications' => function($q){ $q->friendship(); }])->get(); 但是我们现在需要以某种方式反转范围。 我可以想出两种方法来解决这个问题。 1.添加负范围 public function scopeNotFriendship($query){ return $query->where('object_type', '!=', 'Friendship Request' ... -
我真的不明白为什么你使用hasMany关系而不是belongsToMany 。 实际上,您的数据库结构似乎已经被Laravel中的belongsToMany关系所利用。 我的解决方案 user.php的 belongsToMany('Role'); } protected $table = 'users'; protecte ...
-
通过运行命令创建迁移 : php artisan make:migration users_disabled_column 其中disabled是要添加到现有表的列的名称。 使用添加列编辑新迁移,以下是示例:您可能需要更新自动加载器。 感谢您发布解决方案 - 其他人无疑会感激。 You may need to update your autoloaders. Thank you for posting the solution - others will no doubt appreciate it.
相关文章
更多- [How to] Make custom search with Nutch(v 1.0)?(转)
- 我一点onclick为什么总是提交表单
- HTML5 Video元素【HTML5教程 - 第三篇】
- Hadoop的I/O
- Who AM I Casting Crowns自我简介
- HTML5 Video Doc【HTML5教程 - 第四篇】
- 《Android视频教程》(Android Video Course)毕业答辩结束,俺胡汉三又回来了。太多邮件没有回复,抱歉。酝酿酝酿,继续录制视频,敬请期待[DVDRip]
- 《尚学堂科技.高淇.JAVA300集视频教程13年7月20日更新》(java video courses)
- [转]Top 20 Programming Lessons I've Learned in 20 Years
- I18n的一个问题
最新问答
更多- 带有简单redis应用程序的Node.js抛出“未处理的错误”(Node.js with simple redis application throwing 'unhandled error')
- 高考完可以去做些什么?注意什么?
- Allauth不会保存其他字段(Allauth will not save additional fields)
- Flask中的自定义中止映射/异常(Custom abort mapping/exceptions in Flask)
- sed没有按预期工作,从字符串中间删除特殊字符(sed not working as expected, removing special character from middle of string)
- 怎么在《我的世界》游戏里面编程
- .NET可移植可执行文件VS .NET程序集(.NET Portable Executable File VS .NET Assembly)
- 搜索字符串从视图中键入两个字段的“名字”和“姓氏”组合(Search Strings Typed from View for Two Fields 'First Name' and 'Last Name' Combined)
- 我可以通过配置切换.Net缓存提供程序(Can I switch out .Net cache provider through configuration)
- 在鼠标悬停或调整浏览器大小之前,内容不会加载(Content Does Not Load Until Mouse Hover or Resizing Browser)
- 未捕获的TypeError:auth.get不是函数(Uncaught TypeError: auth.get is not a function)
- 如何使用变量值创建参数类(How to create a parameter class with variant value)
- 在std :: deque上并行化std :: replace(Parallelizing std::replace on std::deque)
- 单元测试返回Connection对象的方法(Unit Test for a method that returns a Connection object)
- rails:上传图片时ios中的服务器内部错误(rails: server internal error in ios while uploading image)
- 如何在Android中构建应用程序警报[关闭](How build an application Alarm in Android [closed])
- 以编程方式连接到Windows Mobile上的蓝牙耳机(Programmatically connect to bluetooth headsets on Windows Mobile)
- 在两个不同的SharedPreference中编写并获得相同的结果(Writing in two different SharedPreference and getting the same result)
- CSS修复容器和溢出元素(CSS Fix container and overflow elements)
- 在'x','y','z'迭代上追加数组(Append array on 'x', 'y', 'z' iteration)
- 我在哪里可以看到使用c ++源代码的UML方案示例[关闭](Where I can see examples of UML schemes with c++ source [closed])
- SQL多个连接在与where子句相同的表上(SQL Multiple Joins on same table with where clause)
- 位字段并集的大小,其成员数多于其大小(Size of bit-field union which has more members than its size)
- 我安装了熊猫,但它不起作用(I installed pandas but it is not working)
- Composer - 更改它在env中使用的PHP版本(Composer - Changing the version of PHP it uses in the env)
- 使用JavaFX和Event获取鼠标位置(Getting a mouse position with JavaFX and Event)
- 函数调用可以重新排序(Can function calls be reordered)
- 关于“一对多”关系的NoSQL数据建模(NoSQL Data Modeling about “one to many” relationships)
- 如何解释SBT错误消息(How to interpret SBT error messages)
- 调试模式下的Sqlite编译器错误“初始化程序不是常量”(Sqlite compiler errors in Debug mode “initializer is not a constant”)