小编HWD*_*HWD的帖子

Web Safe字体权重 - 如何变薄?

当我在Photoshop设计,我的字体是薄而脆,但是当我在CSS中声明的字体 - 即使使用的字体重量:轻 - 字体总是出现大胆.

也许这就是浏览器是如何呈现的字体(在IE浏览器的字体保持身材苗条),但我不知道是否有达到同样薄,脆长相任何技巧或提示.

css fonts

25
推荐指数
3
解决办法
4万
查看次数

HTML5视频停止onClose

我正在使用jQuery工具进行叠加.在叠加层内我有一个HTML5视频.但是,当我关闭叠加层时,视频会继续播放.我知道如何在关闭叠加层时让视频停止播放?这是我的代码:

$("img[rel]").overlay({ onClose: function() { <stop the video somehow> }, mask: { color: '#000', opacity: 0.7 }});
Run Code Online (Sandbox Code Playgroud)

我试过用

$('video').pause();
Run Code Online (Sandbox Code Playgroud)

但这也暂停了叠加层.

jquery html5 html5-video

17
推荐指数
5
解决办法
11万
查看次数

PHP mail()附件问题

有人可以帮我弄清楚为什么这会一直变回虚假?

$to = "myemail@mydomain.com";
$from = "Website <website@mydomain.com>";
$subject = "Test Attachment Email";

$separator = md5(time());

// carriage return type (we use a PHP end of line constant)
$eol = PHP_EOL;

// attachment name
$filename = "document.pdf";

//$pdfdoc is PDF generated by FPDF
$attachment = chunk_split(base64_encode($pdfdoc));

// main header
$headers  = "From: ".$from.$eol;
$headers .= "MIME-Version: 1.0".$eol; 
$headers .= "Content-Type: multipart/mixed; boundary=\"".$separator."\"".$eol.$eol; 
$headers .= "Content-Transfer-Encoding: 7bit".$eol;
$headers .= "This is a MIME encoded message.".$eol.$eol;

// message
$headers .= "--".$separator.$eol;
$headers …
Run Code Online (Sandbox Code Playgroud)

php email attachment

16
推荐指数
1
解决办法
3万
查看次数

使用FPDF通过PHP向PDF附件发送电子邮件

我想通过电子邮件发送PDF作为使用FPDF创建的附件.我的代码看起来像这样,但附件永远不会出现.

<?php
require('lib/fpdf/fpdf.php');

$pdf = new FPDF('P', 'pt', array(500,233));
$pdf->AddFont('Georgiai','','georgiai.php');
$pdf->AddPage();
$pdf->Image('lib/fpdf/giftcertificate.jpg',0,0,500);
$pdf->SetFont('georgiai','',16);
$pdf->Cell(40,10,'Hello World!');
$doc = $pdf->Output('test.pdf', 'S');

//define the receiver of the email
$to = 'myemail@example.com';
//define the subject of the email
$subject = 'Test email with attachment';
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: reply@test.com\r\nReply-To: …
Run Code Online (Sandbox Code Playgroud)

php pdf attachment fpdf

15
推荐指数
2
解决办法
6万
查看次数

整个域名的Facebook赞的总数

有没有办法可以检索当天整个网站的总喜欢数量?基本上,我想显示当天每篇博文的Like总数.

facebook facebook-like

15
推荐指数
2
解决办法
1万
查看次数

如何通过分类术语从自定义WordPress MySQL查询中排除结果

我只想展示那些没有分类"产品品牌"的"品牌slu"一词的帖子.

我当前的查询不适用过滤器:

SELECT DISTINCT * FROM $wpdb->posts AS p
  LEFT JOIN $wpdb->postmeta AS meta ON p.ID = meta.post_id
  LEFT JOIN $wpdb->term_relationships AS rel ON rel.object_id = p.ID
  LEFT JOIN $wpdb->term_taxonomy AS tax ON tax.term_taxonomy_id = rel.term_taxonomy_id
  LEFT JOIN $wpdb->terms AS term ON tax.term_id = term.term_id
WHERE 1=1
    AND p.post_type = 'product' 
    AND p.post_status = 'publish' 
    AND p.post_title LIKE '%$trimmed%' OR (meta.meta_key = 'product_model' AND meta.meta_value LIKE '%$trimmed%') 
    AND (tax.taxonomy = 'product-brand' AND term.slug NOT IN ('$protected'))
Run Code Online (Sandbox Code Playgroud)

分类法或slug条件似乎都不适用于上述查询.

任何帮助表示赞赏!

php mysql wordpress custom-taxonomy

13
推荐指数
1
解决办法
712
查看次数

当前导航位置没有滚动链接定位

我在Firefox控制台中出现以下错误,并伴有抖动动画:

此网站似乎使用滚动链接定位效果.这可能不适用于异步平移;

我检查了Firefox的支持帖子,但我没有看到任何与我的场景相关的示例.

我有一个基于锚点的导航菜单,指示访问者当前在页面上的位置.这是我用来处理这个的jQuery:

$(window).scroll(function(){

    var scrollpos   = $(this).scrollTop();
    var pad         = $('.panel_header').outerHeight();

    $('.form_group').not('.sub_group').each(function(i){

        if(scrollpos + $(window).height() == $(document).height()){

            $('ul.tabs li').removeClass('active_tab');
            $('ul.tabs li:last-child').addClass('active_tab');

            return false;

        } else if(scrollpos+pad < $(this).position().top+($(this).height()/2)){

            var id  = $(this).attr('id').replace('-table','-tab');
            var tab = $('#'+id);

            if(tab.length > 0){

                $('ul.tabs li').removeClass('active_tab');
                tab.addClass('active_tab');
            }
            return false;
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

基本上,我正在检查锚点位置的滚动位置,如果锚点在附近,则切换CSS类.CSS处理过渡效果.

有没有另一种方法来实现这一点,不需要滚动链接定位效果,导致抖动滚动?

css firefox jquery scroll-position

7
推荐指数
1
解决办法
488
查看次数

Wordpress wp.media特色图片ID

如何在单击"设置特色图像"按钮时挂钩到现有的wp.media对象并获​​取附件ID?

我一直在看的wp.media教程似乎都是从创建一个新的wp.media框架开始的,但我只是想监听来自现有的事件(由wp_editor()函数呈现),特别是"Set"特色图片"活动.

javascript wordpress wp-editor

6
推荐指数
1
解决办法
906
查看次数

Google自动填写公寓号码

当用户将公寓号添加到他们的地址时,自动填充似乎认为它正在查看邮政编码,并更改建议的匹配:

6250 Hollywood Boulevard#20

有没有办法让这个工作,或者如果没有,一种方法来忽略公寓号码并将其与表单提交一起作为单独的值发送?(请记住,用户可能会使用#,Unit,Apt等来定义其单位编号)

var placeSearch, autocomplete;

var componentForm = {
    street_number:                  'short_name',
    route:                          'short_name',
    locality:                       'long_name',
    administrative_area_level_1:    'short_name',
    country:                        'long_name',
    postal_code:                    'short_name'
};

function initialize(){

    autocomplete = new google.maps.places.Autocomplete(
        (document.getElementById('autocomplete-address')),
        { types: ['geocode'] });
        google.maps.event.addListener(autocomplete, 'place_changed', function(){
            fillInAddress();
        }
    );

}

function fillInAddress(){

    var place = autocomplete.getPlace();

    for(var component in componentForm){

        document.getElementById(component).value = '';
        document.getElementById(component).disabled = false;

    }

    for(var i = 0; i < place.address_components.length; i++){

        var addressType = place.address_components[i].types[0];

        if(componentForm[addressType]){

            var val = place.address_components[i][componentForm[addressType]];

            document.getElementById(addressType).value = val; …
Run Code Online (Sandbox Code Playgroud)

autocomplete google-maps-api-3 street-address

6
推荐指数
1
解决办法
3786
查看次数

使用 AWS EC2 实例加快上传速度

我在美国西部(俄勒冈)可用性区域有一个 t2.medium 实例,具有 EBS 卷和 EFS。

\n\n

用户(通常不在加利福尼亚州)可以使用 javascript 文件上传器上传图像文件,但无论用户的连接速度有多快,他们的上传速度似乎都不能超过 ~500kb/s。

\n\n

例如,如果用户以 5mb/s 的速度测试上传速率,然后上传 5MB 的图像文件,仍然需要近 11 秒才能完成。

\n\n

当我使用 FTP 上传文件时,我得到了类似的结果。

\n\n

我最初的想法是我应该将我的实例更改为具有更好网络性能的实例 \xe2\x80\x94 但由于我直接上传到 EFS 而不是亚马逊存储桶或其他东西,我不确定网络是我的问题。

\n\n

如何才能获得更快的上传速度?这是我的实例的限制吗?

\n

file-upload amazon-ec2 amazon-web-services

5
推荐指数
1
解决办法
4640
查看次数