我无法找到如何使这个链接到CakePHP中我的图像:
<img src="img/default.png" width="130" style="position: absolute; top: 0px; left: 0px; z-index: 3; opacity: 0; ">
$html->image('default.png').....????;
Run Code Online (Sandbox Code Playgroud)
非常感谢!
我有以下HTML:
<a href="myPage.htm">
<img src="anImage.jpg />
</a>
<a href="yourPage.htm">
<img src="anotherImage.jpg />
</a>
<a href="everyonesPage.htm">
<img src="stillAnotherImage.jpg />
</a>
Run Code Online (Sandbox Code Playgroud)
以下javascript(使用jQuery):
$(document).ready(function(){
$('a').live('click', function(e){
e.preventDefault();
alert($('img', this).attr('src'));
});
});
Run Code Online (Sandbox Code Playgroud)
在Firefox中,这会警告单击图像的src属性,但在IE7和IE6中它会警告"未定义".任何想法为什么以及如何在单击相关的锚标签时返回图像的src?
编辑:对不起家伙,这里的jsFiddle示例(http://jsfiddle.net/wabqw/)与原始代码(是的,上面的代码是一个简化版本).适用于Chrome但没有IE(firefox无法显示图像,因此没有任何内容可以点击!).
<html>
<head>
<style type="text/css">
*{padding:0;margin:0;}
body{
background: -webkit-gradient(
linear,
right bottom,
left top,
color-stop(0.25, #F5A432),
color-stop(0.63, #F0F050)
);
background: -moz-linear-gradient(
right bottom,
#F5A432 25%,
#F0F050 63%
);
}
.box{margin-left: 33px; width:100px; height: 100px; background-color:rgb(69,69,69); border: 1px solid rgb(56,56,56);border-radius: 25px; float:left}
#container{padding-left: 37%; padding-right: 30%; width: 1000px; background-color: rgb(64,64,64); position:fixed}
</style>
</head>
<body>
<div id="container">
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
上面的代码中没有显示渐变!只是一个纯白色的背景.为什么?
我正在创建一个网络应用程序.虽然它工作得很好,但在轨道上的ruby中将"<%%>"标签内的整段代码编写起来非常难看.
我试图在我的controller.rb中定义一个函数,然后从html页面调用它.这不起作用,因为它无法识别该功能.
我很感激这里有任何帮助.我把功能放在了正确的位置吗?我需要使用"require"加载吗?
例如:
控制器文件:
class WelcomeController < ApplicationController
def index
end
def myfunc(x)
puts x
end
end
Run Code Online (Sandbox Code Playgroud)
HTML文件(index.html):
<h1>Welcome</h1>
<p>
<%= myfunc(5) %>
</p>
Run Code Online (Sandbox Code Playgroud) 当我尝试从表中访问任何内容时,我收到错误"表或视图不存在".我通过PHP使用PDO和OCI驱动程序.我一直很难找到通过PHP使用oracle的帮助.
$dbh = new PDO("oci:dbname=listst", DB_USER, DB_PASS);
Run Code Online (Sandbox Code Playgroud)
当我尝试时,select * from entriedLevels我什么也得不回来(即使entriedLevels存在且用户具有select访问权限).
当我尝试时,select OBJECT_NAME from user_objects where object_type = 'TABLE'我什么也得不回来.
当我尝试时,select TABLE_NAME from all_tables我终于可以看到所有的表格了.
我为我糟糕的写作道歉,这是一个星期五漫长的一天结束......有点脑死了.
我试图看看是否有更有效的方法来编写ifif语句.编写API以根据调用类的参数数量生成URL.
对于Ex:
def Cars(self, model=null, color=null, miles=null)
if model == null and color == null and miles ==null:
url = cars/
elif model != null and color == null and miles ==null:
url = cars/model=%s)% model
elif model != null and color != null and miles ==null:
url = cars/model=%s/color=%s)% model, color
else url = someting
return url
Run Code Online (Sandbox Code Playgroud)
我有超过10个参数,并且不想用所有组合编写那么多elif语句.